Three ways to rank the same query.
Every search runs keyword, semantic, and hybrid retrieval side by side — so the difference between matching strings and matching meaning is impossible to miss.
One query, three rankings
Each path has a real engine behind it — no hand-waving.
Keyword
BM25 · Elasticsearch
Ranks by literal term overlap across title, brand, category and description. Fast, transparent, and the honest strawman every semantic system has to beat.
Semantic
dense vector · pgvector
Embeds the query with bge-small and ranks by cosine similarity — so “affordable notebook” finds the budget Chromebook that shares no keywords.
Hybrid
reciprocal rank fusion
Fuses both rankings with RRF under a tunable α. It recovers the literal match and the intent match — usually the best relevance of the three.
“cheap gaming laptop”, three ways
Keyword nails the literal match but misses the value picks. Semantic reads the intent but drops the exact model. Hybrid keeps both.
| Keyword | Semantic | HybridBEST | |
|---|---|---|---|
| Top result | Gamer Pro 17 | Budget Chromebook | Gamer Pro 17 |
| Reads “cheap”? | No — literal terms only | Yes — as budget intent | Yes |
| Typical miss | Budget / value picks | The exact model asked for | — |
| Best for | Exact names & SKUs | Synonyms & paraphrases | General shopper queries |
What happens on every search
Parse the query
Natural-language price filters are pulled out (“laptop under 300”) before retrieval runs.
Run three engines
Keyword, semantic, and hybrid execute in parallel on every search.
Fuse & rerank
RRF blends rankings; an optional cross-encoder refines the top candidates.
Score & diversify
MMR suppresses near-duplicates; NDCG/Recall/MRR are computed on labeled queries.
