Table of Contents
How Searching Works
Updated
by Niamh Ferns
How Searching Works in DeskDirector
In all products DeskDirector has created, we use full-text search for all list interfaces. Different to traditional contains or starts with approach, full-text search provides flexibility that the traditional approach cannot compete with. It is also not perfect; it has trade-offs.
For more info regarding this technology, you can check out this Wikipedia page.
How do indexing and tokenisation work?
For each collection, we will mark a few properties as query fields. The information within will be tokenised and indexed by the database. Compared to a traditional database query, full-text search requires breaking down information into tokens. When searching, we search based on tokens instead of a full sentence.
Basic tokenisation for English splits information by spaces, special characters, and new lines. All tokens are case-insensitive.
Input string of text:
The quick brown fox jumped over the lazy dogs, Bob@hotmail.com 123432.
Output tokens:[quick] [brown] [fox] [jumped] [over] [lazy] [dog] [bob@hotmail.com] [123432]How does the system determine the most matched object?
When DeskDirector analyses search terms, it will tokenise the search string. It will match on two different criteria, and the one with the highest rating will be returned first.
- Any token that's exactly matched will give a rating of 2
- Any token that starts with the search term will give a rating of 1.
- A repeat match will increase its total rating.
For example, we have two users with the following names.
Jamison Knight / jknight@example.com from Euro Health CenterJamison Coon / jamison@secondcompany.com from Europtimum
Scenario:
Search term: Euro Jamison will give a rating of 4 for Jamison Knight and a rating of 3 for Jamison Coon. Since Jamison Coon only has a starts-with match with Europtimum, while Jamison Knight has an exact match with Euro.
What kind of terms can we use for different collections?
DeskDirector has put a lot of effort into analysing the important fields that should be included in inside the index. I will summarise them below.
- Company / Account: name, identifier
- Contact: first name, last name, primary email, secondary emails, title, email domain.
- Member / Resource: first name, last name, primary email, secondary emails, identifier
- Ticket: title, initial description, identifier
Frequently Asked Questions
"How many terms can we include in the search?"
Same as many other full-text search implementations. You can include as many terms as you like. You can even type in a full sentence.
"Why can't we add sorting to the search results?"
Without search, sorting is allowed. With search, sorting will only create confusion. For example, if sorting results by text, then higher-rated results could end up on page 2 or 4.
That is the reason why full-text search never allow for ordering. e.g. Google
"When I search contacts, there are results from different companies. How do I improve accuracy?"
You can add an email as an addition to an existing search term, or you can also add a company filter. That way, only contact from that company will be returned.
"How come there are many false positives?"
Full-text searching is likely to retrieve many documents that are not relevant to the intended search question. Such documents are called false positives. They often appear at the end of search results, where they are partially matched with search terms.