Home / Insights / Generative AI and LLMs
Generative AI and LLMs
Keyword, Vector or Hybrid Search? Choosing Retrieval for Enterprise Knowledge Search
The retrieval method decides which passages your knowledge assistant ever sees. This guide compares keyword, vector and hybrid search for enterprise content, explains where each one fails, and shows how to choose with your own questions rather than a vendor’s benchmark.
Key takeaways
- Keyword search is precise for codes, names and exact phrases; vector search handles paraphrase and vague questions. Enterprise content usually needs both.
- Hybrid search merges the two result lists, commonly with reciprocal rank fusion, and a re-ranker then orders the merged candidates.
- Permission filters must work with whichever method you pick; approximate vector indexes can return fewer results when heavily filtered.
- Choose with a labelled test set of your own questions and compare retrieval hit rate per question type.
- Start simple, measure, and add re-ranking or query rewriting only where the test set shows a gap.
On this page
When a knowledge assistant gives a poor answer, the language model usually gets the blame. In our experience the cause is more often upstream: the passage that contained the answer was never retrieved, so the model had nothing correct to work with. Retrieval design is therefore one of the highest-leverage decisions in an enterprise knowledge search project.
There are three broad options. Keyword (lexical) search matches the words in the query against an inverted index, typically scored with BM25. Vector (semantic) search converts text into embeddings and finds passages whose meaning is close to the query. Hybrid search runs both and merges the results. Each has a place, and the right answer depends on what your documents and users look like.
How the three approaches behave on real enterprise content
| Query type | Keyword search | Vector search | Hybrid |
|---|---|---|---|
| Product code, part number, clause ID (“SKU-4471”, “section 12.3”) | Strong: exact token match | Weak: codes carry little meaning in embeddings | Strong |
| Paraphrased question (“can I claim a taxi home after working late?”) | Weak if the policy uses different words | Strong | Strong |
| Internal acronyms and jargon | Strong if users and documents use the same acronym | Variable: depends on whether the embedding model has seen the term | Usually strong |
| Names of people, customers, projects | Strong | Variable | Strong |
| Vague, exploratory questions | Weak | Strong | Strong |
| Multilingual content | Needs per-language analysers | Good with a multilingual embedding model | Good |
The pattern is consistent: keyword search wins on exact identifiers, vector search wins on meaning, and most organisations have plenty of both. Technical manuals, contracts and product catalogues are dense with codes and defined terms; HR and policy questions are full of everyday paraphrase.
How hybrid search and re-ranking work
A hybrid pipeline typically has three steps.
- Parallel retrieval. The query runs against a keyword index and a vector index, each returning its own top candidates.
- Fusion. The two ranked lists are merged. A widely used method is reciprocal rank fusion (RRF), which scores each document by summing 1/(k + rank) across the lists it appears in. Elasticsearch documents RRF with a default rank constant of 60 and notes that it needs no tuning, because it uses ranks rather than raw scores that are not comparable between methods.
- Re-ranking. A cross-encoder or model-based re-ranker reads the query and each candidate together and reorders them. Re-rankers are slower per document, so they are applied to a short merged list, not the whole index.
Weighted score blending is an alternative to RRF, but it requires normalising scores and tuning weights per collection. We generally start with rank-based fusion and only move to weighting if the test set shows a consistent bias.
Query-side techniques
Beyond the retrieval method itself, two techniques often help: expanding acronyms and synonyms from a maintained glossary before the keyword query, and asking a model to rewrite conversational follow-up questions (“what about contractors?”) into standalone queries. Both are cheap to test against the same evaluation set.
Permissions, metadata filters and the hidden recall problem
Enterprise search almost always filters results: by user permissions, department, region, document type or effective date. How filtering interacts with retrieval is easy to overlook.
Approximate nearest-neighbour indexes in many vector stores apply filters after the index is scanned. The pgvector documentation gives a clear example: if a filter matches 10% of rows, an HNSW query with default settings may return only about four matching rows on average instead of the number requested. Newer versions add iterative scans to keep searching until enough results are found, and alternatives include partial indexes or partitioning by tenant.
The practical consequences are:
- Test retrieval as different user roles, not only as an administrator who can see everything.
- Check result counts for heavily filtered queries; a near-empty list is a retrieval failure even if the answer looks plausible.
- Prefer filtering at query time inside the search engine over removing results afterwards in application code.
We compare vector store behaviour in more depth in choosing a vector database for a permission-aware RAG product.
A decision guide
| Situation | Reasonable starting point |
|---|---|
| Small, well-written policy library, everyday language | Vector search, with keyword fallback for names and codes |
| Technical manuals, specifications, contracts with clause numbers | Hybrid from the start |
| Existing Elasticsearch or OpenSearch estate that users already trust | Add vector fields and hybrid fusion to the existing engine rather than introducing a new store |
| Very large corpus, strict latency target | Hybrid with a small re-rank window; measure latency per stage |
| Customer-facing help centre with short articles | Hybrid with re-ranking; article titles weighted in the keyword index |
The technology list matters less than people expect. Elasticsearch, OpenSearch, Azure AI Search, Qdrant and PostgreSQL with pgvector can all support some form of hybrid retrieval. The deciding factors are usually what your team already operates, how permissions are modelled, and where data is allowed to reside.
Testing the choice with your own questions
Vendor benchmarks use public datasets that rarely resemble your SharePoint or Confluence. Make the choice with a labelled set of your own questions instead. Our article on building a test set for enterprise knowledge search explains how to assemble one.
- Tag each test question by type: identifier lookup, paraphrase, acronym, multi-passage, unanswerable.
- Run keyword-only, vector-only and hybrid configurations against the same index content.
- Compare retrieval hit rate in the top results per question type, not only overall.
- Add a re-ranker and measure the change and the added latency.
- Repeat as a restricted user to confirm filters do not quietly reduce recall.
A per-type breakdown usually makes the decision obvious. If vector search misses most identifier questions and keyword search misses most paraphrases, hybrid is justified. If one method wins everywhere for your content, keep the simpler design.
Common mistakes
- Blaming the model for retrieval failures. Check whether the gold passage was retrieved before rewriting prompts.
- Ignoring chunking. A clause split across two chunks may never rank well in either method. Chunk on document structure where possible.
- Passing too many passages. More context is not always better; low-relevance passages distract the model. Re-rank and pass fewer.
- Embedding everything with one model and never revisiting. Changing the embedding model means re-indexing; plan for it and test before switching.
- No glossary. Internal acronyms are a frequent source of misses and are cheap to fix with a maintained synonym list.
For background on how embeddings and language models represent text, see transformers and language models explained for product teams.
Frequently asked questions
Is vector search always better than keyword search for RAG?
No. Vector search handles paraphrase well but often struggles with codes, part numbers and exact names. Most enterprise collections contain both kinds of query, which is why hybrid retrieval is a common choice.
What is reciprocal rank fusion?
A method for merging ranked result lists by scoring each document on its rank in each list rather than its raw score. It avoids having to normalise keyword and vector scores, which are not directly comparable.
Do we need a re-ranker?
Not always. Add one if your test set shows the right passage is usually retrieved but not near the top. Measure the latency it adds, since re-rankers process each candidate with the query.
Can we keep our existing Elasticsearch or OpenSearch cluster?
Often yes. Both support vector fields and hybrid retrieval, and reusing an engine your team already operates can be simpler than adding a separate vector database.
Sources and methodology
Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.
- Elastic: Reciprocal rank fusion (Elasticsearch reference) — Definition of RRF, the 1/(k + rank) scoring and the default rank constant of 60.
- pgvector: Open-source vector similarity search for Postgres (GitHub README) — Behaviour of filtering with approximate indexes, iterative scans and partitioning options.
Related reading
Continue your research
Is your knowledge assistant missing answers that are in the documents?
We can test keyword, vector and hybrid retrieval against your own questions and recommend the simplest design that meets your quality bar.
