Search is more than textual matching
On this page
Search isn’t just a letter-by-letter comparison. Compare searches on these sentences (records):
- To be or not to be that is the question
- This was the best of times the worst of times
- Ask not what your country asks of you but what you can do for your country
- For a long time I used to go to bed early
- Shakespeare and Dickens are both famous British authors
- By George, I should’ve known that! I’ll be a dickens!
- An accomplished woman almost always knows more than we men, though her knowledge is of a different sort
- A search for “ask” returns one result: sentence 3.
- A search for “time” returns two result: sentences 2 and 4.
- A search for “be” returns four results: sentence 1 and 6 “be”, sentence 2 “best”, and sentence 4 “bed”.
Where textual matching doesn’t work
Consider these searches on the preceding sentences:
- “qestion” (“question” mistyped). No sentences are returned.
- “be”. What sentence should come first? The ones that match exactly (the word “be”)? Or some other criteria?
- “literary quotes”? Textual matching doesn’t know anything about these sentences - are these political or literary quotes? The quotes need to be classified, tagged as coming from novels, politicians, authors, countries.
All these queries require something more.
Going beyond textual matching
Simple textual matching won’t solve every search problem: it’s only the starting point.
By adding more information to the preceding sentences (records), their relevance can be improved:
- “To be or not to be, that is the question”, shakespeare, british, hamlet, theater
- “It was the best of times, it was the worst of times”, dickens, british, tale of two cities, novel
- “Ask not what your country asks of you but what you can do for your country”, kennedy, american, speech, politics
- “For a long time I used to go to bed early”, proust, french, recherche, novel
- “Shakespeare and Dickens are both famous British authors”, georgette, british, history of british literature, essay
- “By George, I should’ve known that! I’ll be a dickens!”, landly, british, my fair lady, theater
- “An accomplished woman almost always knows more than we men, though her knowledge is of a different sort.”, george elliot, british, middlemarch, novel
A good search experience also needs to consider filtering, attribute priorities, custom ranking, handling typos, synonyms, and more. Insights from user actions, analytics, personalization, and A/B testing can also help you fine-tune your search experience to better meet the needs of your users.