AIForum.

Hybrid Search for RAG: When to Combine BM25 and Vector Search

On this page

THE SHORT ANSWER

Hybrid search runs a lexical BM25 search and a vector similarity search over the same corpus, then fuses the two ranked lists into one result set. It is the right default when queries mix exact tokens such as error codes and product IDs with paraphrased intent, because the two methods fail in complementary ways. This guide explains how fusion works, when hybrid retrieval earns its extra cost, and how to measure whether it actually improved your RAG pipeline.
Quick facts

Hybrid search runs two retrieval methods over the same corpus — a lexical keyword search such as BM25 and a vector similarity search — and fuses their ranked results into a single list. It is the right default for retrieval-augmented generation (RAG) when your queries mix exact tokens (product codes, error IDs, named entities) with paraphrased intent, because the two methods fail in complementary ways rather than one dominating the other.

This article is for practitioners building or tuning a RAG pipeline who need to decide whether hybrid retrieval earns its extra cost, and how to combine the two signals without guesswork.

Two retrieval methods, two failure modes

BM25 is a lexical ranking function. It scores documents by term overlap and term rarity, which makes it strong on exact terms, product codes, error messages, named entities, and any query where the user typed words that should literally appear in the result, according to Microsoft’s documentation for hybrid search in Azure HorizonDB. Its weakness is paraphrase: a document that answers the question in different words may score poorly or not at all.

Vector search embeds the query and the documents and ranks by similarity in that embedding space. It is strong on synonyms, paraphrases, and semantic intent — the case where the right document does not share the user’s exact words. Its weakness is the mirror image: a rare literal token such as an internal error code may carry little or no signal in the embedding, because the model never learned a meaningful representation for it.

Because those weaknesses do not overlap, hybrid retrieval is not simply “vector search plus a little keyword matching.” It is a way to cover a gap that neither method closes alone.

How fusion turns two rankings into one

In practice, hybrid search executes both retrievals, normalizes or ranks their outputs, and combines them into a final ordering. Weaviate’s documentation describes this as running the vector search and the BM25 search in parallel, combining the normalized scores with a fusion method, and returning results ranked by the combined score. Azure HorizonDB uses Reciprocal Rank Fusion (RRF) for the same purpose.

Weaviate supports two fusion strategies, and the default changed between versions:

  • relativeScoreFusion — each object is scored by normalizing the metrics returned by the vector search and the keyword search. The highest value becomes 1, the lowest becomes 0, and everything else falls between; the total is a scaled sum of the normalized vector distance and the normalized BM25 score. This is the default from Weaviate v1.24.
  • rankedFusion — each object is scored by its position in each result list, starting from the highest score for the top-ranked object and decreasing down the order; the total is the sum of the rank-based scores. This was the default for v1.23 and lower.

Weaviate notes that relativeScoreFusion generally may be the better choice because it retains more information from the original searches, while rankedFusion keeps only the rankings. That distinction matters when you tune: rank-based fusion is insensitive to how confident each retriever was, whereas score-based fusion carries that confidence forward — along with any quirks in how each retriever’s scores are distributed.

Rank-based fusion sidesteps a real problem: BM25 scores and vector distances are not on comparable scales, and their distributions drift with corpus size and query type. By using positions instead of raw values, RRF avoids inventing a normalization that may not hold across queries. The tradeoff is the one Weaviate describes — you lose the magnitude information that score-based fusion preserves.

A concrete example

The Azure HorizonDB documentation uses a query that makes the split visible: "connection timeout error PG-4012". It carries two signals at once.

  • The literal token PG-4012 is a precise identifier. Vector search likely misses it, because the embedding model never saw that identifier during training.
  • The phrase "connection timeout error" is semantic. BM25 might match the words, but a different document phrased as "the database stopped responding after the network dropped" is a better answer that BM25 does not surface.

Pure vector search misses the first signal. Pure BM25 misses the second. Hybrid retrieval returns candidates that satisfy both, which is why Microsoft describes hybrid search as the default retrieval pattern for production AI applications on HorizonDB, including agentic apps, knowledge bases, recommendation engines, support search, and RAG over enterprise content.

That example generalizes. If you can write a query against your own corpus that contains both an exact token and a paraphrase, you have found a case where hybrid retrieval is likely to beat either method alone.

Deciding whether your pipeline needs it

Work from your query log rather than from principle. Hybrid retrieval earns its cost when several of these hold:

  • A meaningful share of queries contain identifiers, error codes, SKUs, version strings, or proper nouns that must match literally.
  • Users type short, keyword-like queries rather than full sentences.
  • Your corpus mixes prose with structured or semi-structured records such as tickets, changelogs, or API references.
  • Your embedding model is general-purpose and has not been fine-tuned on your domain’s vocabulary.

Conversely, a pipeline answering long natural-language questions over homogeneous prose, where no answer depends on an exact string match, may not gain enough from the lexical half to justify the extra retrieval. The honest way to settle it is a labeled query set, described below.

What the platforms handle for you

The integration work differs by stack. Azure HorizonDB runs hybrid search inside the database, so embeddings and text stay in one system rather than being copied to a separate search service. The components are BM25 full-text search via pg_textsearch (Preview), vector search via the pgvector extension (Preview), and scalable vector indexing with DiskANN (Preview). Microsoft’s article walks through setting up tables and indexes, generating embeddings in SQL, running a hybrid query, combining hybrid search with metadata filters, adding a semantic reranker, and performance notes.

Weaviate exposes hybrid search as a query mode with a configurable fusion strategy, so the main decision is which strategy to use and how to weight the two signals.

Two practical notes. First, the HorizonDB features are documented as Preview, which is relevant if you are planning production timelines. Second, the “generate embeddings in SQL” step means embedding generation becomes part of your database workload; that has cost and latency implications you should measure rather than assume.

Measuring whether hybrid actually helped

Fusion strategy debates are unproductive without a baseline. A workable evaluation loop:

  1. Collect 50–200 real queries from your logs, including a deliberate mix of identifier-heavy queries and paraphrase queries.
  2. Label the document or passage that should be retrieved for each.
  3. Run three configurations over the same set: BM25 only, vector only, and hybrid.
  4. Compare recall@k (did the right document appear in the top k at all?) and a ranking metric such as MRR or nDCG (how high did it appear?).
  5. Break the results down by query type. A single aggregate number will hide the fact that hybrid usually helps identifier queries and sometimes does nothing for pure paraphrase queries.

Recall@k is worth watching separately, because fusion reorders candidates but does not create them. If the correct document is not in the top-k of either retriever, no fusion strategy will surface it; the fix is a better retriever or a larger candidate pool, not a different fusion formula.

Limitations and tradeoffs to plan for

Cost and latency. Hybrid search performs two retrievals per query. Microsoft’s HorizonDB article includes a performance section for this reason. Budget for the additional work before you enable it everywhere.

Score normalization is a tuning surface. With score-based fusion, the normalization step determines how much each retriever contributes. Changing corpus size or embedding model can shift the distributions and change the effective balance.

Fusion cannot repair missing candidates. As above, both retrievers must return the answer somewhere in their candidate lists for fusion to rank it well.

Preview and version churn. The HorizonDB components are Preview, and Weaviate’s default fusion strategy changed between v1.23 and v1.24. Pin versions and record which fusion strategy you evaluated, or your benchmark results will not be reproducible.

Reranking is a separate lever. Microsoft’s outline includes adding a semantic reranker for a final accuracy bump, which is a distinct stage from fusion: fusion merges two ranked lists, while a reranker rescores a candidate set with a more expensive model.

A practical starting point

If you are already running vector-only RAG and want to know whether hybrid is worth it: export a sample of real queries, tag the ones containing exact tokens, and build the labeled set described above. Run the three configurations. If hybrid improves recall@k on the identifier-heavy slice without hurting the paraphrase slice, adopt it and keep the fusion strategy you measured. If it does not, you have saved yourself a second retrieval path in production.

If you are starting fresh, hybrid is a reasonable default for enterprise content, support search, and knowledge bases where identifiers and paraphrases appear in the same query mix — which is exactly the profile Microsoft describes as the production default on HorizonDB.

Readers building this out are welcome to share their query mix, chosen fusion strategy, and measured recall@k in the community so others can compare configurations.

FAQ

Does hybrid search always beat vector-only retrieval?

No. It helps most when queries contain exact tokens that embeddings represent poorly, such as error codes, SKUs, or named entities. On long natural-language questions over homogeneous prose, the lexical half may add cost without changing the ranking. The only reliable answer comes from running BM25-only, vector-only, and hybrid over the same labeled query set and comparing recall@k and a ranking metric.

What is the difference between fusion and reranking?

Fusion merges two ranked lists from separate retrievers into one ordering — Reciprocal Rank Fusion in Azure HorizonDB, or relativeScoreFusion and rankedFusion in Weaviate. Reranking is a later, separate stage: it takes the fused candidate set and rescores it with a more expensive model. Microsoft's HorizonDB article lists adding a semantic reranker as a step after the hybrid query, described as a final accuracy bump.

Which Weaviate fusion strategy should I choose?

relativeScoreFusion is the default from Weaviate v1.24 and is generally recommended because it retains more information from the original searches. rankedFusion was the default for v1.23 and lower and keeps only rank positions. If you are comparing results across versions, record which strategy produced them, since the default changed.

Can hybrid search find a document that neither retriever returned?

No. Fusion reorders candidates; it does not create them. If the correct passage is absent from both the BM25 and the vector top-k lists, no fusion strategy will surface it. The remedy is a stronger retriever, better chunking, or a larger candidate pool.

References

  1. https://learn.microsoft.com/en-us/azure/horizondb/ai/hybrid-search
  2. https://docs.weaviate.io/weaviate/concepts/search/hybrid-search

Related terms

BM25
A lexical ranking function that scores documents by term overlap and term rarity; strong on exact terms and identifiers, weak on paraphrase.
Vector similarity search
Retrieval that embeds the query and documents and ranks by distance in embedding space; strong on synonyms and semantic intent, weak on rare literal tokens.
Reciprocal Rank Fusion (RRF)
A rank-based fusion method that combines result lists using each item's position rather than its raw score, avoiding the problem of incomparable score scales.
relativeScoreFusion
A Weaviate fusion strategy that normalizes vector and BM25 scores so the highest becomes 1 and the lowest becomes 0, then sums the scaled values. Default from v1.24.
rankedFusion
A Weaviate fusion strategy that scores each object by its position in the vector and keyword result lists. Default for v1.23 and lower.
pgvector
A PostgreSQL extension for vector storage and similarity search; used for the vector half of hybrid search in Azure HorizonDB (Preview).
Semantic reranker
A separate stage after retrieval that rescores a candidate set with a more expensive model; distinct from fusion, which only merges ranked lists.

Leave a Reply

Your email address will not be published. Required fields are marked *