Skip to main content

Overview

Typo tolerance ensures that customers find the products they’re looking for even when their search queries contain spelling mistakes or typing errors. A shopper searching for “snekaers” will still see sneaker results, and “espreso machine” will return espresso machines. This happens automatically and seamlessly, requiring no additional effort from the customer. The system applies corrections intelligently, only making changes when there’s high confidence that a typo has occurred. This prevents over-correction of intentional spellings while still catching common mistakes that would otherwise lead to poor or empty search results.

How Typo Correction Works

Layers analyzes search queries to detect and correct common typing mistakes. The correction process considers several factors to determine whether a word is likely misspelled and what the intended word might be.

Types of Errors Detected

The system recognizes patterns that commonly occur during typing. Character proximity errors happen when a shopper accidentally hits an adjacent key on the keyboard, such as typing “shirr” instead of “shirt”. Missed characters are omissions that occur during fast typing, like “dres” instead of “dress”. Transposed letters are characters typed in the wrong order, such as “teh” instead of “the” or “recieve” instead of “receive”. Beyond simple typos, the system also handles phonetic misspellings where words are spelled as they sound rather than correctly, and double-letter errors where a letter is accidentally repeated or a double letter is reduced to one.

High-Confidence Corrections Only

The system only applies corrections when confidence is high. This conservative approach prevents the frustration of having intentional searches incorrectly “corrected” to something the customer didn’t want. If the system is uncertain whether something is a typo or an intentional search term, it leaves the query unchanged and relies on other search capabilities to find relevant results.

What Typo Tolerance Preserves

Certain types of text are intentionally left unchanged to preserve search accuracy for specialized queries.

Brand and Product Names

Brand names, model numbers, and product-specific terminology are not corrected, even if they appear to be misspellings of common words. A search for “Acne Studios” (the fashion brand) won’t be changed to “Acme Studios”, and product codes or SKUs remain intact.

Stylized Spellings

Many brands and products use intentional non-standard spellings as part of their identity. The system recognizes that “Froot Loops” is not a misspelling of “Fruit Loops” and that “Krispy Kreme” should not be corrected to “Crispy Cream”. These stylized catalog spellings are preserved.

Niche and Technical Terms

Industry-specific terminology, technical specifications, and niche fashion or product terms are handled carefully. The system avoids correcting terms that might be unfamiliar but are legitimate product descriptors used in your catalog.

Regional Spelling Variations

Layers handles regional spelling differences intelligently based on the shopper’s location. A customer in the United Kingdom searching for “colour” will see results for color products, while an American customer’s search for “color” works equally well. The same applies to other regional variations like “grey” versus “gray” or “centre” versus “center”. When a query term is already correct and idiomatic for the customer’s locale, the system does not replace it with another regional synonym. Regional context influences how queries are understood without forcing unnecessary changes to correctly-spelled terms.

Working with Query Expansion

Typo tolerance works alongside Query Expansion as part of the broader query understanding system. When a typo is corrected, the corrected query may then be expanded with synonyms and related terms to further improve search results. For example, if a customer searches for “lbd” (a common abbreviation), the system first normalizes this to “little black dress” and then may expand it to include related terms like “black cocktail dress” or “black evening dress”. This combination of correction and expansion ensures customers find what they’re looking for even when their initial query is abbreviated or misspelled.

Transparency in Search Results

When typo correction is applied, the search response includes information about what corrections were made. This allows your storefront to optionally display messages like “Showing results for ‘espresso machine’” when the original query was “espreso machine”, helping customers understand why they’re seeing certain results. For details on accessing this information in API responses, see the Search API documentation.

See Also