# What is hybrid search?

> Hybrid search runs keyword and vector search together and merges the two ranked lists. How the merge works, when it helps a RAG system and how to test it.

Source: https://www.honeyhive.ai/learn/hybrid-search (updated 2026-11-16)

Hybrid search runs a keyword search and a vector search over the same content and merges the two result lists into one ranking. It is the usual retrieval step in a [RAG pipeline](/learn/rag-pipeline) when queries mix exact terms with questions in natural language.

Each method fails differently. Elastic [says](https://www.elastic.co/what-is/hybrid-search) lexical search can miss content that is worded differently, and semantic search can add noise when the context is ambiguous. Hybrid search offsets both.

## Why keyword search stays in the mix

Embeddings capture meaning, not spelling. Anthropic [writes](https://www.anthropic.com/news/contextual-retrieval) that embedding models "can miss crucial exact matches", and gives the query "Error code TS-999" as an example where an embedding search may return general error-code content instead of the exact match. BM25, the standard keyword ranking function, looks for the exact string, which makes it useful for unique identifiers and technical terms.

The reverse also holds. The BEIR benchmark, [18 public datasets](https://arxiv.org/abs/2104.08663) built to test retrieval models on data they were not trained on, found BM25 a robust baseline, while dense retrieval models are cheaper to run but often underperform other approaches. Neither side wins everywhere, which is the case for running both.

## How the two lists are merged

The two retrievers score documents on different scales, so the merge step is the real design choice. There are two families.

| Method | How it works | Trade-off |
|---|---|---|
| Reciprocal rank fusion (RRF) | Scores each document from its rank in each list, ignoring raw scores. | Elastic [recommends](https://www.elastic.co/what-is/hybrid-search) it as the starting point because it needs little tuning. It throws away how far apart scores were. |
| Normalize, then weight | Rescales each retriever's scores to a common range (for example min-max), then combines them with weights. | Elastic [notes](https://www.elastic.co/what-is/hybrid-search) it gives finer control but needs experimentation and is sensitive to the dataset. |

Documentation from search engines shows how the two look in practice:

- Elastic's [RRF docs](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/reciprocal-rank-fusion) set `rank_constant` to 60 by default, where a higher value gives lower-ranked documents more influence. `rank_window_size` sets how many top results each retriever contributes before fusion.
- OpenSearch offers both in a search pipeline. Its [normalization processor](https://docs.opensearch.org/latest/vector-search/ai-search/hybrid-search/index/) converts each clause's scores to a common scale and keeps the margins between documents, so it fits when score gaps matter. Its score ranker uses RRF and suits a setup where you have not yet measured how the clauses score. The docs example combines `min_max` normalization with an `arithmetic_mean` and weights of 0.3 and 0.7.
- Cloudflare's AI Search [defaults](https://developers.cloudflare.com/ai-search/configuration/indexing/hybrid-search/) to `rrf`, which it recommends for most use cases, and offers `max`, which keeps the higher normalized score. [Reranking](/learn/reranking) there is optional and off by default.

## What the gain looks like

Anthropic's September 2024 tests on a mix of codebases, fiction and papers are one of the few public numbers for adding BM25. With a baseline top-20 retrieval failure rate of 5.7%, [contextual embeddings alone reached 3.7%](https://www.anthropic.com/news/contextual-retrieval), adding contextual BM25 reached 2.9%, and adding a reranker on the top 150 chunks reached 1.9%. These are Anthropic's datasets, not yours, and the BM25 step there is applied to chunks that had context prepended (see [chunking strategies](/learn/chunking-strategies)).

## How to test it on your own data

Hybrid search adds a second index and a merge step, so it should earn its place on your queries.

1. Collect real queries, including ones with product names, identifiers and error strings, and mark which documents should come back (a [golden dataset](/learn/golden-dataset) is the usual form).
2. Score keyword only, vector only and hybrid on the same set with retrieval metrics such as [context precision and recall](/learn/context-precision-and-recall).
3. Vary one thing at a time: the merge method, the weights or rank constant, and the number of results each retriever contributes.
4. Check the final answers too, with the checks in [RAG evaluation](/learn/rag-evaluation), since better retrieval does not always give a better answer.

The embedding side matters as well, and its scores follow the rules in [semantic similarity](/learn/semantic-similarity).

## Tracing retrieval

When a hybrid query returns the wrong chunk, you need to see what each retriever returned and how the merge ordered them. HoneyHive's [LlamaIndex integration](https://docs.honeyhive.ai/v2/integrations/llamaindex.md) traces query engines, retrieval and embeddings, so those steps show up as spans. For how traces are structured, see [LLM tracing](/learn/llm-tracing).

## FAQ

### What is hybrid search?

Search that runs two methods, usually keyword (lexical) and vector (semantic), and merges them into one ranked list. Elastic [describes it](https://www.elastic.co/what-is/hybrid-search) as blending two or more search methods into a single ranked list.

### What is reciprocal rank fusion?

A way to merge result lists using each document's rank instead of its score. Elastic's [docs](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/reciprocal-rank-fusion) say it needs no tuning and the retrievers' scores do not have to be related, and give 60 as the default rank constant.

### Is hybrid search better than vector search?

Often, for queries with exact terms such as identifiers or error codes. Anthropic's [tests](https://www.anthropic.com/news/contextual-retrieval) cut the top-20 retrieval failure rate from 3.7% to 2.9% by adding BM25 to contextual embeddings. That is one team's data, so measure on your own queries.

### Do you need to normalize scores in hybrid search?

Only if you combine scores directly. Elastic [says](https://www.elastic.co/what-is/hybrid-search) linear combination needs scores normalized to a comparable range, while reciprocal rank fusion uses ranks and skips that step.
