Problem
Keyword search returns nothing when the query word is absent from the records. Users type "canou" for "canoe", say "trousers" when the catalog says "pants", or add one word too many and get an empty page. Loosening the match fixes this, but too much of it buries good results under irrelevant ones.
Example from the article: a clothing store's index holds "pants" and "trousers". A thesaurus also links "slacks" to laziness and looseness, but in this index only "pants" and "trousers" are relevant synonyms.
Solution in brief
Add controlled fuzziness on top of exact textual matching: typo tolerance limited by edit distance, hand-curated synonyms, prefix and partial-phrase matching, and optional filters. Rank every fuzzy match below the exact match. The user sees the best match first and the broader results after it.
Questions this case answers
- How to broaden keyword matching to cover misspellings and alternative wording while keeping exact matches on top
- How to return useful results for a multi-word query when no record matches all of its words
- How to make product search return results when users mistype a word or use different vocabulary?
- How to add typo tolerance without letting misspelled matches outrank exact ones?
Tools and methods
- Typo tolerance (Damerau–Levenshtein distance) — matches words within a small spelling distance of an indexed word
- Synonyms — declares which words are equal in this catalog
- Prefix search — matches partial words as the user types
- Optional words and removal of words — keeps multi-word queries from returning nothing
- Optional filters and filter scoring — adds records outside the filters but ranks them lower
- Algolia, Elasticsearch, Coveo, Constructor.io — engines the article names as offering fuzzy matching; it describes Algolia's variant
Google or a one-time email code. No password.