RAG·11 min read·2,108 words

RAG vs Traditional Search: What Changed, What Did Not, and Why BM25 Is Not Dead

Traditional search returns documents. RAG returns answers. That gap sounds simple but it changes everything about how you build, evaluate, and maintain an information retrieval system. This guide breaks down how keyword search, semantic search, and RAG differ, where each wins, and why the best production systems in 2026 combine all three.

Krunal Kanojiya

Krunal Kanojiya

·Updated
Share:
#bm25#elasticsearch#keyword-search#llm#rag#retrieval-augmented-generation#semantic-search#traditional-search#vector-search
RAG vs Traditional Search: What Changed, What Did Not, and Why BM25 Is Not Dead

In 2016, when a user searched your company's internal wiki for "password reset steps," they got a list of ten documents sorted by keyword relevance. They clicked the first result, skimmed three paragraphs, found the steps, and did the thing.

In 2026, that same query goes into a RAG system. The system retrieves the relevant sections from your documentation. The LLM reads them. It returns: "To reset your password, go to Account Settings, click Security, then select Reset Password. You will receive an email within two minutes."

Same underlying information. Different interface. Different outcome.

The retrieval mechanics have more in common than most people think. What changed is what happens after retrieval - and that change has enormous implications for when you use which system.

What Traditional Search Actually Does

Traditional search is a retrieval and ranking problem. You have a corpus of documents. A user submits a query. The search engine scores every document for relevance to that query and returns a ranked list.

BM25 - Best Match 25 - is the algorithm that has dominated that ranking problem for two decades. It is the default ranking function in Elasticsearch, Apache Solr, and OpenSearch. It evaluates relevance using three signals: how often the query terms appear in the document (term frequency), how rare those terms are across the entire corpus (inverse document frequency), and document length as a normalization factor.

BM25 sees text as a bag of tokens. It has no understanding of language, meaning, or intent. It matches words, not concepts. A document that says "cardiac arrest treatment protocol" will rank low for the query "heart failure emergency procedures" even though those phrases describe the same clinical situation. The words do not overlap.

Elasticsearch has powered over 80% of the world's search infrastructure on the strength of this model. Fast, interpretable, scalable to billions of documents, cheap to run. For use cases where users know the right words and exact matching is what they need - log search, compliance document lookup, product SKU search - BM25 is still hard to beat.

What BM25 cannot do is understand that "money back guarantee" and "refund policy" describe the same thing, or that a question about "what to do if my payment fails" should retrieve a document titled "billing error resolution." For that, you need semantic understanding.

What Semantic Search Adds

Semantic search converts queries and documents into dense vector embeddings - numerical representations that capture meaning rather than surface form. Documents about similar concepts cluster together in vector space regardless of the specific words used. A query about "heart failure emergency procedures" retrieves documents about "cardiac arrest treatment protocol" because those phrases land near each other in the embedding space.

Vector search can match "cardiac arrest" to a document about "heart failure" even though none of the words overlap, because the embedding model has learned that these concepts live close together in semantic space.

This is powerful. It is also not a replacement for keyword search. Semantic search has a mirror-image weakness to BM25. Where BM25 misses synonyms and paraphrases, semantic search misses exact terms. A product code like AX-7200-PRO, an error string like ECONNREFUSED, or a statute number like § 1983 may embed poorly relative to their meaning in context. The embedding model tokenizes these identifiers into subword pieces that do not cluster near the exact string a user searches for.

This is the core tension that drove the development of hybrid retrieval - and it is the reason BM25 is more alive than ever in 2026.

Why Traditional Retrieval Still Matters

Query needTraditional keyword retrievalSemantic retrieval
Exact identifiers, quoted text and rare namesStrongInconsistent
Paraphrases and conceptual questionsLimited by word overlapStrong
Score explanationBased on visible term evidenceBased on vector proximity
Direct document lookupNatural fitOften unnecessary

Neither retrieval style covers every query. This comparison owns that decision-level distinction; Hybrid Search for RAG owns how a system combines them.

What RAG Adds on Top of Retrieval

RAG does not replace the retrieval layer. It extends it.

Traditional search returns a list of documents ranked by relevance. The user reads those results. RAG takes the top-ranked results, passes them to a language model as context, and asks the model to synthesize a direct answer from what it retrieved. The user receives an answer, not a list of documents.

plaintext
Traditional Search Flow
+---------------------------+
|  User Query               |
|          |                |
|          v                |
|  BM25 / Vector Index      |
|          |                |
|          v                |
|  Ranked Document List     |  <-- user reads this and extracts answer
+---------------------------+

RAG Flow
+---------------------------+
|  User Query               |
|          |                |
|          v                |
|  Search / Retrieval Index |
|          |                |
|          v                |
|  Reranker                 |
|          |                |
|          v                |
|  Top-k Chunks (context)   |
|          |                |
|          v                |
|  LLM Generation           |
|          |                |
|          v                |
|  Synthesized Answer       |  <-- user reads this
|  + Source Citations       |
+---------------------------+

The retrieval step inside RAG is identical in structure to traditional search. What changes is the terminal step. Instead of presenting documents for the user to read, RAG feeds those documents to a model that reads them on the user's behalf and produces a direct, synthesized, cited answer.

This has consequences in both directions.

RAG wins when: The user needs an answer, not a document. When the relevant information is spread across multiple sections of multiple documents and the user would need to read and cross-reference all of them to construct the answer themselves. When the query is conversational and contextual, building on previous turns. When traceability and citation of sources matter for compliance.

Traditional search wins when: The user needs the source document, not a summary. When the corpus has very high query volume and sub-second response is required. When exact document retrieval is the goal - a compliance audit that requires the specific PDF, not a model's interpretation of it. When the cost per query of running an LLM at scale is unjustifiable for the value it adds.

Why BM25 Still Belongs in Modern Retrieval

Semantic retrieval did not make traditional search obsolete. BM25 remains valuable because exact identifiers, quoted phrases, names, error strings, and regulated terminology often need literal matching rather than conceptual similarity.

That does not mean every RAG system must use the same combined pipeline. It means lexical retrieval is still a valid component when the query mix demands it. The mechanics of running BM25 and dense search together, merging their results, configuring RRF, and evaluating fusion belong in Hybrid Search for RAG.

Where Traditional Search Still Wins Outright

BM25 keyword matching is fast and precise: 10 to 50 milliseconds even on 10GB document collections. A basic RAG pipeline adds the embedding computation plus the LLM generation step, pushing total end-to-end latency to 1 to 3 seconds for a straightforward query. With reranking, 1.5 to 3.5 seconds. With agentic multi-hop retrieval, 5 to 15 seconds.

For use cases where that latency gap matters, and where the generation step adds no value, traditional search is the right architecture.

Use CaseTraditional SearchRAGWinner
E-commerce product catalog searchFast, exact match on SKU and attributesLLM generation adds latency, no valueTraditional Search
Log analysis and monitoringSub-millisecond exact match, aggregationGeneration not neededTraditional Search
Compliance document retrievalUser needs the exact PDF, not a summaryCitation to specific document matters but generation adds riskTraditional Search
Internal knowledge base Q&ARelevant but spread across 5 docsSynthesis saves user 20 minutes of readingRAG
Customer support chatbotUser wants an answer, not a listDirect answer with source reduces support loadRAG
Legal case researchExact case citation retrievalMulti-document synthesis for complex questionsBoth
Code documentation searchExact function name or error matchingConversational explanation with contextHybrid
Medical literature reviewExact term matching for drug namesCross-document synthesis for clinical questionsBoth

The Migration Path: Elasticsearch to RAG

Most organizations already have an Elasticsearch or Solr deployment that handles their internal search. The question is not "should we replace it with RAG?" It is "how do we layer RAG generation on top of what we already have?"

Teams running existing search infrastructure can add RAG without replacing the retrieval layer. The search system continues returning relevant source passages; an LLM consumes those passages and generates an answer. This preserves exact-match, filtering, and operational-search workloads that already work.

plaintext
Existing Elasticsearch Index
          |
          v
Ranked Results (with source metadata)
          |
          v
LLM Generation Layer
          |
          v
Synthesized Answer + Citations

Organizations that already run Elasticsearch for structured operational search can keep it for those workloads and add a RAG layer over the unstructured documentation subset - the product manuals, policy documents, and knowledge base articles that benefit from conversational answer generation. This avoids the operational complexity of replacing a working system while capturing the value of RAG for the use cases that justify it.

How Evaluation Differs

Traditional search evaluation uses information retrieval metrics: precision (fraction of retrieved documents that are relevant), recall (fraction of all relevant documents that were retrieved), MRR (Mean Reciprocal Rank - how high does the first relevant result appear), and NDCG (Normalized Discounted Cumulative Gain - a weighted measure of ranked list quality).

RAG evaluation requires a different framework because the output is a generated answer, not a ranked list. RAGAS measures faithfulness (whether generated claims are grounded in retrieved context), answer relevancy, context precision, and context recall. Traditional IR metrics apply to the retrieval component of a RAG pipeline. RAGAS metrics apply to the end-to-end pipeline.

Metric TypeWhat It MeasuresUsed For
Precision@kFraction of top-k results that are relevantRetrieval layer only
Recall@kFraction of all relevant docs in top-kRetrieval layer only
MRRAverage rank of first relevant resultRetrieval layer only
NDCGRanked list quality weighted by positionRetrieval layer only
RAGAS FaithfulnessAnswer grounded in retrieved contextFull RAG pipeline
RAGAS Answer RelevancyAnswer addresses the questionFull RAG pipeline
RAGAS Context PrecisionRetrieved chunks are relevantRetrieval layer, RAG context
RAGAS Context RecallRight chunks were retrievedRetrieval layer, RAG context

A complete evaluation framework for a hybrid RAG system runs both sets of metrics. Retrieval metrics tell you whether the right documents are surfacing at the right ranks. RAGAS metrics tell you whether the end-to-end system is producing correct, grounded answers. Low context precision in RAGAS combined with good precision@10 in IR evaluation points to a reranking problem - the right documents are in the top 10 but are not being placed at the top of the context where the LLM can attend to them.

The Practical Decision

The decision between traditional search and RAG is not binary for most organizations. It is a question of what you add on top of what you already have, and where the generation layer earns its cost.

If users need documents, use traditional search. If users need answers synthesized from documents, use RAG. If your corpus mixes structured operational data with unstructured knowledge, use traditional search for the former and RAG for the latter.

If your queries require both exact terms and semantic matching, evaluate a combined retrieval layer. The complete BM25/vector fusion, RRF, implementation, and testing workflow belongs in Hybrid Search for RAG.

For how retrieval fits into the full RAG architecture, read RAG Architecture Explained. For vector storage, see Vector Database in RAG. For retrieval failures, see Why RAG Fails.

The final article in this series covers the embedding models that power both the dense retrieval side of hybrid search and the semantic understanding that makes RAG meaningfully better than pure keyword search: How Embeddings Work in RAG.

If you are still deciding whether RAG is the right architecture for your problem at all, start with What Is RAG in AI and RAG vs Fine-Tuning.

Sources

  1. RAGAS
  2. BM25 - Best Match 25 - is the algorithm that has dominated that ranking problem for two decades
  3. Elasticsearch has powered over 80% of the world's search infrastructure
  4. ragaboutit.com
  5. Solr, built on Apache Lucene - the same foundation as Elasticsearch - has powered enterprise search since 2006
  6. exuverse.com

Frequently Asked Questions

What is the difference between RAG and traditional search?

Traditional search returns a ranked list of documents or passages that match a query. The user reads those results and extracts the answer themselves. RAG takes that retrieval step and feeds the results directly to a language model, which reads the retrieved content and generates a synthesized, conversational answer. Traditional search surfaces documents. RAG surfaces answers. The retrieval mechanics overlap significantly - both can use BM25, semantic similarity, or hybrid approaches - but the output and the downstream use are completely different.

Is BM25 still relevant in a world of vector search and RAG?

Yes, and it is an active component in most production RAG systems. BM25 is not an alternative to semantic search - it is a complement. Dense vector search is excellent at finding semantically similar content but consistently misses exact keyword matches, product codes, error identifiers, and rare proper nouns. BM25 handles exactly those cases and remains useful whenever exact lexical evidence matters.

Can you use Elasticsearch as the retrieval layer in a RAG system?

Yes. Elasticsearch added native vector search support in version 8.x and supports lexical and vector retrieval. Teams already running Elasticsearch for traditional search can add a RAG generation layer on top without replacing their existing infrastructure. Elasticsearch handles the retrieval. An LLM handles the generation from those results. This is a practical migration path for organizations with existing Elasticsearch deployments.

When does traditional search beat RAG?

For high-volume, low-latency queries where exact document retrieval is the goal rather than synthesized answers, traditional search wins on cost and speed. E-commerce product search, log analytics, compliance document lookup, and any use case where the user needs to read the source document rather than receive a generated summary are all cases where traditional search is appropriate and RAG is overkill. RAG adds latency and cost per query through the generation step. If generation adds no value, it adds only overhead.

Does RAG replace enterprise search platforms like Elasticsearch or Solr?

Not entirely, and not for most teams. Elasticsearch and Solr excel at structured filtering, faceted search, log analytics, and exact-match retrieval at billion-document scale. RAG excels at synthesizing answers from unstructured knowledge. The practical 2026 pattern is to keep Elasticsearch for structured operational search and add a RAG layer on top of a subset of the corpus - typically the unstructured documentation, policy, and knowledge base content that benefits from conversational answer generation.

How does latency compare between traditional search and RAG?

Traditional keyword search with BM25 returns results in 10 to 50 milliseconds even on 10GB document collections. A basic RAG pipeline adds the embedding step plus the LLM generation step, pushing total latency to 1 to 3 seconds per query. With reranking added, expect 1.5 to 3.5 seconds. Agentic RAG with multiple retrieval passes runs 3 to 10 seconds or more. This latency gap matters for user-facing applications where sub-second response is expected, and it informs where RAG is appropriate versus where traditional search is sufficient.

Follow on Google

Add as a preferred source in Search & Discover

Add as preferred source
Appears in Google Discover
Krunal Kanojiya

Krunal Kanojiya

Technical Content Writer

Krunal is a technical content writer at Lucent Innovation and a former full-stack developer with professional technology experience since 2021. He publishes source-backed, practical guides on AI engineering, RAG, vector search, data engineering, algorithms, and software development.