---
title: "Hybrid search"
type: "glossary term"
url: "https://aifordevs.org/glossary#hybrid-search"
markdown: "https://aifordevs.org/glossary/hybrid-search.md"
publisher: "AI for Devs"
license: "https://aifordevs.org/reuse"
attribution: "Credit AI for Devs and link to https://aifordevs.org/glossary#hybrid-search"
---

# Hybrid search

Hybrid search combines keyword search, usually BM25, with vector search and merges the two ranked lists into one result. Keyword matching catches exact identifiers that embeddings miss, and vectors catch paraphrases that keywords miss.

Reciprocal rank fusion is a common merge step because it uses ranks and needs no score normalization. Each document scores the sum of 1 / (k + rank) across lists, and Elasticsearch defaults k to 60. In Anthropic's own test, adding contextual BM25 to contextual embeddings raised the cut in top-20 retrieval failures from 35% to 49%.

## Example

A document ranked 1st by BM25 and 3rd by vectors scores 1/61 + 1/63, or about 0.0323, with k = 60.

## Source

[Elastic docs: Reciprocal rank fusion](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/reciprocal-rank-fusion)

## Related terms

- [Vector database](https://aifordevs.org/glossary#vector-database)
- [HNSW](https://aifordevs.org/glossary#hnsw)
- [Reranking](https://aifordevs.org/glossary#reranking)
- [RAG](https://aifordevs.org/glossary#rag)
- [Chunking](https://aifordevs.org/glossary#chunking)

## Read the article

[What is a vector database? HNSW, IVF, and when to skip one](https://aifordevs.org/articles/what-is-a-vector-database)

## Cite this term

AI for Devs. "Hybrid search." https://aifordevs.org/glossary#hybrid-search

- Page: https://aifordevs.org/glossary#hybrid-search
- Markdown: https://aifordevs.org/glossary/hybrid-search.md
- Reuse: Quote or summarize with a link to this page. Terms: https://aifordevs.org/reuse
- Publisher: AI for Devs
