$phrase or $fuzzy),
the search engine applies smart matching to find the most relevant results.
This behavior varies based on the input format.
Single-Word Values
For single-word searches, the engine runs multiple matching strategies and combines their scores:- Exact term match (high boost): Documents containing the exact token score highest.
- Fuzzy match (no boost): Documents containing terms within Levenshtein distance 1 (with transpositions counting as a single edit) are included.
- Fuzzy prefix match (no boost): Documents containing terms that start with a fuzzy variation of the search term are included. This handles incomplete words during typing.
- “tabletop” (exact match)
- “tabeltop” (fuzzy match, 1 edit away)
- “tabeltopping” (fuzzy prefix match, incomplete word with typos matches full term)
Multi-Word Values
For multi-word searches, the engine runs multiple matching strategies simultaneously and combines their scores to surface the most relevant results:-
Exact phrase match (highest boost): Documents where all words appear adjacent and in order
score highest. Searching for
wireless headphonesranks documents containing “wireless headphones” as a phrase above those with the words scattered. -
Exact phrase match with slop (medium boost): Documents where all the query terms appear in
order but not necessarily adjacent, allowing for a small number of intervening words—receive a boost.
Searching for wireless headphones would rank documents containing
wireless bluetooth headphonesabove those where the words are far apart, but below an exact phrase match (wireless headphones). - Terms match (medium boost): Documents containing all or some of the search terms, regardless of position or order, receive a moderate score boost.
- Fuzzy matching (no boost): Documents containing terms similar to the search terms (accounting for typos) are included with a lower score.
- Fuzzy prefix on last word (no boost): The last word is also matched with fuzzy prefix, handling incomplete words during search-as-you-type scenarios.
- “Premium wireless headphones with noise cancellation” (phrase match with fuzzy prefix on last word)
- “Headphones with wireless connectivity” (all terms present, different order)
- “Wireles headphone with long battery” (fuzzy match for typos)
Double-Quoted Phrases
Wrapping your search value in double quotes forces exact phrase matching. The words must appear adjacent and in the exact order specified.- “noise and cancelling” (words not adjacent)
- “cancelling noise” (wrong order)
- “noise-cancelling” (hyphenated, tokenized differently)