Skip to content

Fulltext search features

View MD

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.

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:

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

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

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.

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 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”).