Skip to main contentOverview
Query understanding is the intelligence behind how Layers interprets what customers are searching for. When a shopper types a query, the system goes beyond simple keyword matching to understand the meaning, intent, and context behind their search. This enables more relevant results even when the exact words don’t appear in product titles or descriptions.
The query understanding system combines several capabilities working together. Query expansion broadens searches with synonyms and related terms. Intent modifiers detect signals like price sensitivity or sale interest. Contextual awareness uses information about the shopper’s cart, purchase history, and location to personalize results. Together, these capabilities ensure customers find what they’re looking for, even when their query is brief, ambiguous, or uses different terminology than your catalog.
Query Expansion
Query expansion enriches search queries by adding synonyms, related terms, and alternative phrasings that help match products the customer is looking for. This is particularly valuable when customers use different words than those in your product catalog, or when a short query could benefit from additional context.
How Query Expansion Works
When a customer searches, the system analyzes the query and generates related terms that capture the same or similar intent. These expansions are weighted based on how closely they relate to the original query, with direct synonyms receiving higher weight than more loosely related terms.
For example, a search for “sneakers” might be expanded to include “athletic shoes” and “trainers”, while a search for “couch” might include “sofa” and “loveseat”. The original query always remains the primary focus, with expansions serving to broaden the net of potentially relevant products.
Abbreviations and Common Aliases
The system recognizes common shopping abbreviations and normalizes them to their full forms. A search for “lbd” is understood as “little black dress”, “pjs” becomes “pajamas”, and “tee” is recognized as “tee shirt”. This ensures customers using shorthand still find relevant products.
Catalog-Aware Expansion
Query expansion is informed by your actual product catalog. The system knows what product types you sell and avoids suggesting expansions for products you don’t carry. If you sell shoes but not clothing, a search for “running gear” will focus expansions on footwear rather than apparel.
Custom Expansion Instructions
You can provide guidance to help the system understand how your customers talk about your products. This is configured in the dashboard under Settings and allows you to specify synonyms, brand nicknames, or terminology specific to your industry. For example, you might indicate that “hoodie” and “hooded sweatshirt” should be treated as equivalent, or that customers often use specific nicknames for your house brands.
For configuration details, see Open Configuration.
Intent Modifiers
Intent modifiers detect signals in search queries that indicate specific shopping goals, then adjust search behavior accordingly. Unlike query expansion which broadens what products are considered, intent modifiers influence how results are ranked or filtered based on detected intent.
Types of Intent Detection
The system recognizes several categories of intent signals in search queries.
Price Sensitivity: Queries containing phrases like “cheap”, “affordable”, “under $50”, or “budget” indicate price-conscious shopping. The system can boost lower-priced products or apply price filters based on explicit constraints mentioned in the query.
Sale and Discount Interest: Searches including “on sale”, “clearance”, “discount”, or “deal” signal interest in discounted products. The system can prioritize products with active markdowns or compare-at prices.
Feature Preferences: When queries mention specific attributes like “wireless”, “organic”, “waterproof”, or “plus size”, the system recognizes these as feature preferences and adjusts ranking to favor products with those characteristics.
How Intent Modifiers Work
Intent modifiers translate detected signals into search adjustments through three mechanisms. Promotion gently boosts products matching the detected intent higher in results. Demotion lowers products that conflict with the detected intent. Filtering restricts results to only products matching explicit constraints, used sparingly and only when the query clearly requests restriction.
The system is conservative about applying filters, preferring to boost relevant products rather than exclude potentially relevant ones. Explicit price constraints like “under $100” may trigger filters, while softer signals like “affordable” influence ranking without restricting results.
Balancing Discovery and Intent
Intent modifiers are designed to aid discovery rather than over-constrain results. For generic queries like “dress” or “shoes”, the system typically applies no modifications, allowing customers to browse the full range of options. Modifications are applied only when there’s clear intent signal in the query, and even then, the goal is to surface the most relevant products first rather than hide alternatives.
Contextual Awareness
Query understanding incorporates information about the shopper’s current session and history to personalize how queries are interpreted. This contextual awareness helps resolve ambiguity and surface more relevant results.
Cart Context
Products currently in the shopper’s cart provide signals about their shopping mission. If a customer has toddler clothing in their cart and searches for “shoes”, the system recognizes they’re likely looking for toddler shoes rather than adult footwear. This context helps disambiguate generic queries without requiring customers to be more specific.
Purchase History
Past purchases inform understanding of customer preferences. A customer who has previously purchased plus-size clothing may see plus-size options prioritized when searching for apparel. Similarly, brand preferences established through purchase history can influence which products surface first for ambiguous queries.
Geographic Location
Location affects how queries are interpreted in several ways. Regional spelling variations are handled appropriately, so a UK customer searching for “trainers” sees athletic shoes while the same search from a US customer might be expanded to include “sneakers”. Location can also influence which products are most relevant based on climate, local trends, or regional availability.
Prior Searches
Recent search behavior within a session provides context for subsequent queries. If a customer searched for “running shoes” and clicked on several results, a follow-up search for “socks” might be interpreted in the context of athletic or running socks rather than dress socks.
For complete details on contextual information and how to pass it via the API, see Contextual Information.
The Query Understanding Pipeline
When a search query is processed, it flows through several stages that work together to understand and fulfill the customer’s intent.
Query Preprocessing
The query is first cleaned and normalized. This includes standardizing case, handling special characters, and preparing the text for analysis.
Typo Correction
The system checks for likely spelling mistakes and corrects them when confidence is high. A search for “snekaers” becomes “sneakers”. For details on how typo correction works, see Typo Tolerance.
Query Expansion
The normalized query is analyzed to generate relevant expansions including synonyms, related terms, and alternative phrasings. Each expansion is weighted based on relevance to the original query.
Intent Detection
The query is analyzed for intent signals like price sensitivity, sale interest, or feature preferences. Detected intents are translated into ranking adjustments or filters.
Contextual Enhancement
Available context about the shopper (cart contents, location, history) is incorporated to personalize how the query is understood and which products are most relevant.
Search Execution
The processed query, expansions, intent modifiers, and context are combined to execute the search and rank results. The final results reflect all of these factors working together.
Transparency and Debugging
The search response includes metadata about how the query was understood and processed. This information can be used to display helpful messages to customers (like “Showing results for ‘espresso machine’” when they searched for “espreso machine”) or for debugging search behavior.
When testing searches in the Layers dashboard, you can see detailed information about each step of the query understanding pipeline, including what expansions were generated, what intent was detected, and how context influenced the results.
For testing and evaluation tools, see Test Text Search.
Configuration Options
Several aspects of query understanding can be configured to match your catalog and customer base.
Search Behavior Settings
The dashboard provides controls for tuning how text and visual similarity are weighted, setting minimum match thresholds, and controlling expansion strength. These settings are found under Settings in the Search Behavior tab.
Custom Instructions
You can provide custom instructions to guide how queries are expanded for your specific catalog. This is useful for industry-specific terminology, brand nicknames, or regional language variations your customers use.
Search Language
Configure whether your search operates in English only or multilingual mode based on your catalog and customer base. Multilingual mode handles queries and products in multiple languages.
For configuration details, see Open Configuration.
See Also