Home / Blog / Generative AI & RAG
Hybrid Search for RAG: Combining Keywords and Vectors
By Softworth Solutions · · 4 min read · For readers in UAE, India, UK

In short: Hybrid search for RAG runs a keyword search such as BM25 and a vector search on the same query, then merges the results before the LLM sees them. It catches both exact terms like product codes and paraphrased questions, and is one of the most reliable ways to improve retrieval quality.
If your RAG assistant keeps missing answers you know are in the documents, retrieval is usually the culprit, not the model. And the most common retrieval gap is relying on vector search alone.
Why isn't vector search enough on its own?
Because embeddings capture meaning, not exact tokens. Vector search is brilliant at matching how do I get my money back to a refund policy. But ask about error E-4021, invoice INV-88213 or clause 14.2, and the embedding may treat the identifier as noise and return anything vaguely about errors or invoices.
Keyword search has the opposite problem. BM25 ranks documents by how often query terms appear, weighted by rarity. It nails exact matches but has no idea that leave encashment and payment for unused annual leave mean the same thing.
| Query type | Keyword (BM25) | Vector | Hybrid |
|---|---|---|---|
| Product codes, IDs, clause numbers | Strong | Weak | Strong |
| Paraphrased or conversational questions | Weak | Strong | Strong |
| Jargon and internal acronyms | Strong | Mixed | Strong |
| Typos and transliterated words | Weak | Mixed | Better than either |
How does hybrid search work?
- Index each chunk twice: in a keyword index and as an embedding.
- Run both searches in parallel, keeping the top 20 to 50 from each, with the same metadata and access filters applied to both.
- Fuse the two lists, usually with reciprocal rank fusion.
- Optionally rerank the fused candidates with a cross-encoder.
- Send the top three to eight chunks to the LLM with source references.
Reciprocal rank fusion (RRF) ignores raw scores and uses only each document's rank in each list, scoring it as one over a constant plus its rank, often with the constant around 60. Since BM25 scores and cosine similarities sit on different scales, using ranks sidesteps messy normalisation. Weighted score fusion gives you a tuning knob instead, but the right weight has to come from evaluation, not intuition.
A reranker reads the query and each candidate together and scores relevance far more accurately, at the cost of some latency. For knowledge-base assistants it's usually worth it, but measure. Get chunking right first, too; our guide to chunking strategies for RAG explains why.
An illustrative example
Consider an engineering services firm in Dubai with an internal assistant over equipment manuals in English and Arabic. Technicians search by part numbers like VLV-2208 and get irrelevant pages, while vague questions work fine. Adding BM25 alongside the vector index, with RRF and a reranker, fixes the part-number queries without hurting the conversational ones. The team also learns that their Arabic keyword analyser needed configuring separately, which they only spot because the test set included Arabic queries.

Which tools support hybrid search?
You probably don't need a new system. Elasticsearch and OpenSearch support BM25 and vectors with built-in hybrid queries. Azure AI Search offers hybrid retrieval with a semantic ranker. PostgreSQL can do both with full-text search and pgvector, a sensible pick when your data already lives there. Dedicated vector databases such as Weaviate and Qdrant also support keyword or sparse vectors. For a comparison, see our vector database guide.
Language matters in multilingual markets. UAE teams often index Arabic and English together, and Indian teams meet transliterated text such as Tamil written in English letters. Check that your keyword analyser handles each script and your embedding model supports each language.
Key facts
- Reciprocal rank fusion was described by Cormack, Clarke and Büttcher at the SIGIR conference in 2009. (ACM Digital Library)
- Apache Lucene, the engine behind Elasticsearch and OpenSearch, uses BM25 as its default similarity for ranking text. (Apache Lucene)
- pgvector is an open-source PostgreSQL extension for storing embeddings and running vector similarity search. (pgvector on GitHub)
How do you know retrieval actually improved?
Build a test set of 100 to 300 real questions, each labelled with the chunks that contain the answer. Compare vector only, keyword only, hybrid and hybrid with reranking on recall at k, mean reciprocal rank and 95th percentile latency. Include exact-ID questions, paraphrases, short keyword queries and long conversational ones, and re-run whenever you change chunking, embeddings or documents.
Key takeaways
- Combine BM25 and vector search; each covers the other's blind spots.
- Start with reciprocal rank fusion, then test a reranker.
- Apply access filters to both indexes, not just one.
- Prove the gain on a labelled test set before rolling out.
Softworth Solutions (SWS AI) designs and tunes RAG retrieval for clients in India, the UAE and the UK. If your assistant keeps missing answers, let's find out why.
Frequently asked questions
Is hybrid search always better than vector search?
Not always, but it rarely does worse and often does noticeably better on codes, names and jargon. Compare both on a labelled set of your real questions to be sure.
Do I need a reranker as well?
It usually adds a further gain because it judges each candidate against the query directly. If latency is tight, test without it first and add it if evaluation shows a clear improvement.
Does hybrid search work for Arabic content in the UAE?
Yes, provided your keyword analyser is configured for Arabic and your embedding model supports it. Include Arabic and mixed-language questions in your test set to confirm.
Planning an AI or software project? Talk to our team for a free consultation and an honest estimate.
Previous: How Coimbatore Startups Can Use AI Without a Big Budget
Next: AI Vendor Due Diligence: Security, Data and IP Questions to Ask