Skip to main content

Overview

Query interpretation is an AI-powered preprocessing step that runs early in the search pipeline. It analyzes every search query in the context of your store and makes up to three decisions:
  • Typo correction — Fixes spelling mistakes when confidence is very high.
  • Redirect routing — Identifies queries that are looking for help pages, policies, or other non-product content and routes them to your configured semantic redirects.
  • SKU prefix detection — Recognizes when a query looks like a product code or SKU and switches to prefix-based lookup for faster, more accurate results.
These decisions happen automatically and require no configuration. Query interpretation replaces the previous standalone typo correction system with a unified approach that understands the full intent behind a query, not just whether it contains a spelling mistake.

How it works

When a customer searches, the query interpretation system evaluates the search terms alongside your store’s name and description. Using this context, it determines the most likely intent behind the query and returns one of three routing decisions:
RouteWhen it appliesWhat happens
NoneThe query is a normal product searchSearch proceeds normally. If a typo was detected, the corrected query is used.
RedirectThe query looks like a help, policy, or informational requestThe system generates candidate phrases and checks them against your semantic redirects. If a match is found, the customer is redirected.
SKU prefixThe query resembles a product code, model number, or SKUThe system uses prefix matching to find products whose codes start with the query, bypassing semantic search.
Each decision includes a confidence score. Typo corrections are only applied at very high confidence (95%+), and routing decisions require strong confidence (85%+) to activate. When the system is uncertain, the query proceeds unchanged through normal search.

Typo correction

Query interpretation handles typo correction as part of its analysis. When it detects a likely spelling mistake, it returns a corrected version of the query that is used for the rest of the search pipeline. The correction respects the same principles as described in Typo tolerance: brand names, model numbers, stylized catalog spellings, and niche terminology are preserved. Only clear, high-confidence corrections are applied. Because typo correction now happens inside the interpretation step, it benefits from store context. The system considers your store’s product types and description when deciding whether something is a typo or an intentional term, reducing false corrections.

Redirect routing

When a customer types a query like “how do I return my order” or “shipping policy”, they’re not looking for products — they want information. Query interpretation detects these non-product queries and generates short candidate phrases (like “returns”, “return policy”, “how to return”) that are matched against your configured semantic redirects. If a matching redirect is found, the search API returns a redirect response instead of product results, just as if the customer had typed the exact redirect term. If no matching redirect exists, the query falls through to normal search. This means your semantic redirects now catch a wider range of natural-language queries without you needing to anticipate every variation. A redirect configured for “return policy” can now match queries like “how do I send something back” or “what’s your refund process” because the interpretation system generates the right candidate phrases automatically.

How redirect routing differs from semantic matching

Semantic redirects already use AI embeddings to match queries to configured redirect terms. Query interpretation adds an additional layer by first interpreting the query’s intent and generating focused candidate phrases, which are then checked against your redirects. This two-step approach catches queries that semantic embedding similarity alone might miss, particularly conversational or question-style queries.

SKU prefix detection

Some customers search using product codes, model numbers, or partial SKUs. These queries don’t work well with semantic or keyword search because “WKR04” has no meaningful words to match against. Query interpretation recognizes these patterns and switches the search to prefix-based matching, which finds products whose SKU or product code starts with the entered text. This is especially useful for B2B stores, wholesale catalogs, or any store where customers frequently search by product codes.

Caching

Interpretation results are cached automatically. When the same query is searched again, the cached result is used instantly without additional processing. This ensures that the interpretation step adds no latency for repeated searches.

Transparency in the dashboard

When you test a search in the Layers dashboard, the Query Understanding panel shows interpretation results as a Query Routing step. You can see:
  • The routing decision (none, redirect, or SKU prefix) and its confidence level
  • Any typo corrections that were applied
  • The redirect candidate phrases that were generated (for redirect routing)
  • The SKU candidate that was extracted (for SKU prefix routing)
This makes it easy to understand why a particular query was routed the way it was and to verify that the system is making the right decisions for your store.

See also