Fulltext search features
Luigi’s Box Search automatically handles typos, partial matches, and other query imperfections to ensure users find relevant products even when their input isn’t perfect.
Automatic query correction
Section titled “Automatic query correction”When a search query yields no results or very low relevance, the system automatically attempts to augment the query to find a match. This process is transparent to the user but can be displayed in the UI to inform them of the change.
There are three ways a query can be automatically corrected:
Typo correction
Section titled “Typo correction”If a query includes a typo (e.g., searching for sheos instead of shoes), the system corrects it before executing the search. This prevents “no results” screens caused by simple spelling errors.
Example correction:
sheos shoes
Partial matches
Section titled “Partial matches”If a multi-word query returns no results because one term doesn’t exist in the catalog (e.g., searching for shoes whiskey where whiskey is not in the index), the system may ignore the problematic term and search for the valid one.
Example correction:
shoes whiskey
Code correction
Section titled “Code correction”If a user searches for a product code that doesn’t strictly match (e.g., 6834a88asc) but is very close to an existing one (e.g., 6834a77asb), the system can correct the code to find the intended product. Note that code matching is typically strict, so this correction applies only when no exact match is found.
Display corrections
Section titled “Display corrections”In all cases, the API response includes a correction object with the original and corrected queries. You can use the HTML representation provided in the response to show users exactly how their query was interpreted.
Query rewrite
Section titled “Query rewrite”Query rewrite is an advanced feature that allows Luigi’s Box to automatically transform queries to improve results. When enabled, if a user’s query can be better expressed differently (e.g., expanding abbreviations or mapping synonyms), the system rewrites the query before execution.
The rewritten query and the original query are both available in the API response, allowing you to show users what happened (e.g., “Showing results for X instead of Y”).
Was this page helpful?
Thanks.