← Back to Docs
Recipe

Search synonyms strategy

Expand query coverage without diluting relevance by mapping equivalent terms across your catalog.

Problem

Users search for “hoodie” but your products are titled “sweatshirt.” Without synonym mapping, those queries return zero results even when the right inventory exists.

Approach

Maintain a lightweight synonym table keyed by canonical term. At query time, expand the user’s input with all known equivalents before hitting your search index. Keep the table bidirectional so “sweatshirt → hoodie” and “hoodie → sweatshirt” both resolve.

Steps

  1. Audit zero-result queries from the last 90 days. Identify the top 50 terms that should have matched.
  2. Build the synonym map as a flat JSON or KV store. Example: {“sneakers”: [“trainers”, “kicks”]).
  3. Expand at query time by looking up each token in the user’s input. Append synonyms with a lower boost weight to preserve original intent ranking.
  4. Validate weekly by reviewing click-through rates on synonym-expanded results. Prune mappings that generate impressions but no clicks.

Pitfalls

  • Over-expansion: mapping “shirt → top” pulls in irrelevant categories.
  • Stale mappings: seasonal terms like “ugly sweater” need expiration dates.
  • Language drift: regional variants (“flip-flops” vs “thongs”) require locale-aware synonym sets.

Pro tip: Store synonyms in an edge-config or KV layer so updates ship instantly without a full deploy. Pair with a simple admin UI that lets merchandisers add mappings without engineering support.