Search Relevance: How Results Get Ranked
Search relevance is the discipline of scoring and ordering results so the most useful products for a given query appear first — the ranking layer that sits on top of matching.
Matching vs. ranking
Matching decides which products are eligible to show at all. Ranking — relevance — decides the order they appear in. A query can technically match hundreds of products; relevance scoring is what makes the top ten of them useful instead of arbitrary.
Lexical relevance: BM25 and term frequency
The classic approach scores a product based on how often, and how distinctively, the query terms appear in its text fields — the technique behind algorithms like BM25. It is fast and precise for exact or near-exact queries, and remains a common baseline even in modern systems.
Semantic relevance: similarity scoring
Vector-based systems score relevance by distance or similarity in embedding space instead of term overlap, which is what lets them rank a paraphrased or descriptive query sensibly even when it shares no literal words with the matching product.
Blending relevance signals
Most production systems do not rely on one method alone. They combine a lexical score, a semantic score, and business signals — recency, popularity, margin — into one final ranking value, which merchandising or personalization can then adjust further on top.
Evaluating relevance quality
Two main checks are used in practice: human relevance judgments, where a sample of query-result pairs is rated directly, and behavioral proxies, like click-through and add-to-cart rate on top results. Neither alone is sufficient — a model can run without errors while still returning results nobody clicks.
Common questions
What's the difference between relevance and ranking?
The terms are often used interchangeably. Relevance refers to the scoring model itself; ranking is the resulting order those scores produce.
Is BM25 obsolete now that semantic search exists?
No — it remains a strong, fast baseline for exact and near-exact queries, and many hybrid systems keep it as one of several blended signals rather than replacing it outright.
How do you know if a relevance model is actually good?
By combining human relevance judgments on a sample of queries with behavioral proxies like click-through and add-to-cart rate — checking both whether results look right and whether shoppers actually act on them.