What Is Hybrid Search? β Definition and How It Works
Learn what hybrid search is, how rank fusion combines lexical and vector results, why raw scores cannot be added, and how to tune the balance.
Hybrid search runs keyword and vector retrieval over the same corpus and merges the results. It exists because the two approaches fail in opposite directions, and real queries contain both prose and exact tokens.
1. What It Combines
- Lexical retrieval matches terms, excelling at identifiers, error codes, and product names.
- Vector retrieval matches meaning, excelling at paraphrase and conceptual similarity.
A query such as "why does error 1020 keep appearing on checkout" contains both an exact token and a description. Either retriever alone handles half of it.
2. Why Scores Cannot Simply Be Added
The two produce incomparable numbers. Lexical scores are unbounded and corpus-dependent; cosine similarities sit in a narrow band and vary by model.
Normalising them into a shared range is possible but fragile, because the distributions differ by query. Rank-based fusion sidesteps the problem entirely.
3. Reciprocal Rank Fusion
The common approach combines positions rather than scores:
score(d) = Ξ£ over retrievers 1 / (k + rank_r(d))
A document ranked highly by either retriever scores well; one ranked highly by both scores best. The constant k dampens the influence of top positions, so a single retriever cannot dominate.
Its appeal is that it needs no tuning per corpus and no score calibration.
4. Weighting
Where one retriever is known to suit the corpus better, a weight can bias the fusion. Identifier-heavy catalogues lean lexical; prose-heavy documentation leans semantic.
Weights should come from evaluation on real queries, not intuition β the direction is often the opposite of what the team expects.
5. Re-Ranking Above Fusion
Fusion produces a merged candidate list. A re-ranker that scores query and passage together then reorders the top few dozen, and that step usually contributes more quality than tuning the fusion itself.
The full shape: retrieve broadly with both, fuse by rank, re-rank precisely, keep the top few.
6. Filtering Alongside
Metadata filters β date, source, language, tenant β apply to both retrievers and should be enforced consistently. A filter applied to one path and not the other produces results that vary by which retriever surfaced them, which is confusing to debug.
7. When Hybrid Is Not Worth It
- Corpora that are purely conceptual prose with no identifiers.
- Very small corpora, where an exact scan over either representation suffices.
- Latency-critical paths where two retrievals plus fusion exceed the budget.
Otherwise, hybrid is the sensible default rather than an optimisation.
8. Summary
Hybrid search merges lexical and vector retrieval so that exact tokens and paraphrase are both handled, using rank fusion because the two score scales are not comparable.
Add a re-ranking step above the fusion, apply filters identically to both paths, and set any weighting from measured results rather than assumption.