StackLift
All terms

Glossary

Hybrid search

Search that runs keyword and vector retrieval together and merges the results.

Hybrid search combines keyword search, usually BM25, with semantic vector search and merges the two result lists into one ranking. Keyword search catches exact terms such as names and codes, while vector search catches meaning. Together they miss less than either method alone, which is why hybrid retrieval is the common default for production RAG.

A typical setup runs both searches in parallel and fuses the lists, often with reciprocal rank fusion, which uses each result's position instead of its raw score. Many search engines and vector databases now offer this built in.

Hybrid search is often followed by a reranking step that reorders the best candidates before they reach the language model. The mix between the two methods can be tuned against your own test questions.

Start in 60 seconds

Put this to work on your project.

Get an AI-assisted, architect-reviewed scope, cost range, and timeline. Free, no login.

The complete guide

Hybrid search: the complete guide

Updated November 18, 2026 ยท Published by , Founder, StackLift AI. Written with AI assistance; how we make content.

Short answer

Hybrid search runs keyword search, usually BM25, and semantic vector search together, then merges the two result lists into one ranking. Keywords catch exact names, codes and phrases. Vectors catch meaning and paraphrase. Together they miss less than either alone, which is why hybrid retrieval is the common default for production RAG.

Why does hybrid search matter?

Each method fails in a predictable way. Keyword search misses paraphrases and synonyms. Semantic search over embeddings can blur exact identifiers: a part number, a person's surname, a statute section or a product name may land near similar-looking but wrong items.

Where each method is strong and weak
Query typeKeyword (BM25)VectorHybrid
Exact code or ID, such as ERR-4021StrongWeakStrong
Paraphrase, such as get my money backWeakStrongStrong
Rare names and jargonStrongMixedStrong
Long natural-language questionMixedStrongStrong
Multilingual or misspelled queriesWeakOften strongStrong

For RAG systems, retrieval quality sets a ceiling on answer quality. If the right passage is never retrieved, the model cannot use it, however good it is. That is why hybrid retrieval is the usual starting point for production systems.

How does hybrid search work, step by step?

  1. Index each document twice: as text for keyword search, and as an embedding vector for similarity search.
  2. At query time, run the keyword search and get a ranked list.
  3. Run the vector search on an embedding of the query and get a second ranked list.
  4. Merge the lists with a fusion method, such as reciprocal rank fusion or a weighted score.
  5. Apply filters, such as permissions, date, language or document type, before or during retrieval.
  6. Optionally rerank the top candidates with a more precise model.
  7. Pass the final passages to the language model with the question.

The two searches run in parallel, so the added delay is small compared with the model call that follows.

How are the two result lists combined?

Keyword scores and vector similarity scores are on different scales, so you cannot simply add them. Two approaches are common.

Fusion methods
MethodHow it worksTrade-off
Reciprocal rank fusion (RRF)Each result earns a score from its position in each list; scores are summedSimple and robust, with no tuning of score scales
Weighted score blendNormalize both scores, then weight them, for example more weight on keywordsMore control, but needs tuning and re-tuning as data changes
Learned rankingA model trained on click or judgment data merges signalsStrong with enough data, heavy to build
CascadeRetrieve broadly with one method, then re-score with anotherGood for precision, adds a step

Reciprocal rank fusion is a sensible default because it uses each result's position and not its raw score. You can add a weight to favor one retriever, and test the setting on your own questions.

What else goes into a good retrieval pipeline?

Hybrid search is one part of a chain, and the other parts matter as much. How you split documents, called chunking, decides what each result contains. The embedding model decides how well meaning is captured. A reranker re-scores the best candidates by reading the query and passage together, which is slower but more precise than either first-stage search.

Stages and their jobs
StageJobTypical choice
ChunkingCut documents into useful passagesSection-aware chunks with a little overlap
Keyword indexMatch exact termsBM25 in Elasticsearch, OpenSearch or PostgreSQL full-text
Vector indexMatch meaningpgvector, Qdrant, Weaviate or a managed vector service
FusionMerge listsReciprocal rank fusion
RerankingOrder the top candidates preciselyA cross-encoder or hosted reranking API
FilteringEnforce permissions and scopeMetadata filters applied at query time

What are real-world examples of hybrid search?

  • A support assistant finds the article for error code E-2217 by exact match and the article for my payment keeps failing by meaning, in one query.
  • A legal research tool matches statute section numbers exactly while still finding cases that describe the same idea in different words.
  • An ecommerce site matches a product SKU or brand name precisely and also handles shoes for wet weather.
  • A healthcare knowledge base matches drug names and codes exactly while finding guidance phrased differently.
  • An engineering assistant searches code and documentation, matching function names exactly and concepts semantically.
  • An internal company search matches employee names and project codes while still answering policy questions in plain language.

The pattern is always the same: some of what people search for is a precise identifier, and some is an idea. Hybrid search lets one box handle both without making the user choose a mode.

How do you implement hybrid search well?

  1. Collect real questions from users, with the passages that should answer them. This is your test set.
  2. Build a keyword-only and a vector-only baseline and score both.
  3. Add fusion, and compare it with the baselines on the same questions.
  4. Tune chunk size, the retriever weights and how many candidates each side returns.
  5. Add a reranker if the right passage is retrieved but ranked too low.
  6. Add metadata filters and permission checks at query time.
  7. Log queries and results so you can find new failures after launch.

Keep the retrieval settings in configuration, not scattered through code, so you can change weights and candidate counts and re-run your test set without a rebuild.

Pay attention to the language of your content. Stemming, stop words and tokenization differ by language, and a keyword index set up for English will under-perform on other languages without changes.

When is hybrid search more than you need?

Not every product needs two indexes. If you have a small collection, a few hundred short documents, a single good retriever and a reranker may be enough. If every query is an exact lookup, such as an order number, a plain database query or keyword search is simpler, faster and easier to explain.

  • A small, stable set of documents where even basic vector search already finds the right answer.
  • Exact-match lookups where meaning does not matter, such as finding a record by id.
  • A first prototype where you are still deciding what content to include.
  • A platform that does not support both retrieval types and where a migration is not justified yet.

The test set settles it. If keyword, vector and hybrid all score the same on your real questions, keep the simplest option and revisit when the content or the questions change.

What are the common hybrid search mistakes?

Mistakes and fixes
MistakeWhat happensFix
Skipping the test setTuning by feel, regressions go unnoticedBuild a question set first and score every change
Adding raw scores togetherOne method dominates because of scaleUse rank-based fusion or normalize
Chunks that are too large or too smallRelevant text is diluted or cut offChunk by structure and test sizes
Ignoring permissionsSearch surfaces documents a user may not seeFilter by permission in the query, not after generation
Stale indexesEdits and deletions never reach searchUpdate both indexes together on every change
Using a vector store without keyword supportExact terms failChoose a store that supports hybrid, or add a keyword index

What tools and technologies support hybrid search?

Many platforms offer hybrid retrieval built in. Elasticsearch and OpenSearch combine BM25 with vector fields. Weaviate and Qdrant provide hybrid queries. PostgreSQL can do both with full-text search and pgvector in one database, which keeps the stack small for moderate data sizes. Managed cloud search services on AWS, Azure and Google Cloud also offer it.

On the embedding side, you choose a model from providers such as OpenAI, Google or Cohere, or an open-weight model you host. Check how each tool handles permissions, filters and updates before committing. See the integration pages for Elasticsearch, Qdrant and Weaviate.

How do you measure whether hybrid search is working?

Measure retrieval separately from the final answer. For each test question, check whether the right passage appears in the top few results, and how high it ranks. Compare keyword, vector and hybrid on the same set so you can see exactly what hybrid adds.

Then measure the end result: answer correctness, citation accuracy and user feedback. After launch, review queries with no clicks or thumbs-down ratings, since they reveal the gaps. See AI observability and the RAG implementation playbook.

What does hybrid search mean for cost and timeline?

Compared with vector-only search, the extra work is the keyword index, fusion and tuning. If your platform supports hybrid natively, that is small. The bigger drivers are the volume of content, how often it changes, the number of sources, permission rules, and how much evaluation you invest in.

Running costs come from storage, embedding new content, queries and any reranking calls. For ranges, see AI LLM integration cost and the free estimate.

How StackLift approaches hybrid search

StackLift scopes retrieval during discovery: what content, which questions, which permissions. A senior architect reviews the plan, and retrieval quality is tested against a question set agreed with you before it goes live.

Engineers own design choices, agents work on feature branches, and observability and rollback are in the plan from sprint one. See LLM integration.

Questions people ask

What is hybrid search in RAG?

It is retrieval that combines keyword and vector search, then merges the results before passing passages to the language model. It avoids the blind spots of each single method.

What is BM25?

BM25 is a standard keyword ranking formula. It scores documents by how often query terms appear, how rare those terms are overall, and how long the document is.

What is reciprocal rank fusion?

A method that merges ranked lists by giving each result a score based on its position in each list and summing the scores. It avoids comparing scores from different scales.

Is hybrid search better than vector search?

For most real content it retrieves more of the right passages, especially when queries include names, codes or jargon. Test it on your own questions to see how much it helps.

Do I need a reranker as well?

Not always. Add one when the right passage is retrieved but not near the top. Rerankers improve precision at the cost of some latency and expense.

Can I do hybrid search in PostgreSQL?

Yes. Full-text search handles the keyword side and pgvector handles vectors. It works well for moderate sizes and keeps everything in one database.

How do I weight keyword and vector results?

Start with equal treatment through rank fusion, then adjust using your test questions. Content with many exact identifiers may benefit from more keyword weight.

Does hybrid search work for non-English content?

Yes, but both sides need attention. The keyword index needs the right language analysis, and the embedding model should support your languages well.

Sources

Sources and further reading

The standards, rules, research and official documentation this page draws on.