Skip to content

Product updates

Announcements

No active updates

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 a way to control your search and autocomplete results. You can set up query rewrites in the Luigi’s Box application, and they will affect both autocomplete and search results.

If you are using Search.js, query rewrite works out of the box, and no integration is necessary on your side.

If you are using the API to build search, you must adapt your code to incorporate query rewrite functionality.

Each query rewrite has exactly one search query it responds to. Diacritics and case do not matter. You can choose whether to rewrite the query or keep the original one. You can also define filters that will be applied to search requests for the given query.

When creating a query rewrite, you can choose whether to admit to the customer that you rewrote the original query. You can also define a message that will be shown when the query rewrite is applied.

{
"query_rewrite": {
"id": 9,
"original_query": "mini guitar",
"admit_rewrite": true,
"message": "We rewrote your entered query to another with better search results for you."
}
}