SCIENCE · RETRIEVAL

Hybrid search vs vector search vs semantic search

AUTHOR · XERJ documentation team · REVIEWED BY · XERJ engineering team · PUBLISHED · 2026-11-13 · UPDATED · 2026-11-18
SHORT ANSWER · UPDATED 2026-11-18

Hybrid search vs vector search: vector search ranks passages by closeness of meaning, so it finds paraphrases. Hybrid search runs BM25 full-text search next to it and fuses the two ranked lists, so exact names and close meanings both rank. Semantic search usually means vector search. For RAG and AI agents, hybrid is the safer default.

TL;DR Vector search ranks passages by closeness of meaning, so it finds paraphrases. Hybrid search runs a full-text search such as BM25 next to it and fuses the two ranked lists, so exact names and close meanings both rank. Semantic search usually means vector search. For RAG and AI agents, hybrid search is the safer default.

PASTE THIS TO YOUR AI AGENT. IT DOES THE REST Act as a coding agent. Read https://xerj.org/llms.txt, install XERJ, start a local node with --embed-mode neural, index one folder I point you to with xerj autoindex, then run the same question three ways (match, knn, and hybrid with fusion rrf) and show me the top 5 of each side by side with file paths, so I can see what hybrid search adds over vector search.
RUN THIS XERJ COMMAND curl -fsSL https://xerj.org/get | sh Install the single XERJ binary.
RUN THIS XERJ COMMAND xerj --embed-mode neural Start a local node that embeds text with all-MiniLM-L6-v2. The model downloads once, about 90 MB.
RUN THIS XERJ COMMAND xerj autoindex ./docs --url http://127.0.0.1:9200 --progress plain Index a folder. Full-text and vector fields go into the same index.
RUN THIS XERJ COMMAND curl -s -XPOST 'http://127.0.0.1:9200/docs/_search' -H 'content-type: application/json' -d '{"query":{"hybrid":{"queries":[{"query":{"match":{"body":"server unreachable"}},"weight":1.0},{"query":{"knn":{"field":"body_vector","k":10,"num_candidates":50,"query_vector":[]}},"weight":1.0}],"fusion":"rrf"}},"size":5}' One hybrid request. Fill query_vector with your embedding; the empty array marks where the floats go.

Which search fits your queries?

Try it: which search fits your queries?

Answer three questions about your queries and data

What do your users or agents type?
What does a miss look like?
What feeds on the results?

BM25

Full-text search

Scores the query terms each document holds. Strong on exact tokens and fast.

kNN

Vector or semantic search

Ranks by closeness of meaning, so a paraphrase can match.

hybrid + RRF

Hybrid search

Runs both and fuses the two ranked lists, so names and meaning both count.

Runs in your browser and sends nothing. Each answer adds a point to the option it matches. A rule of thumb, not a benchmark; the measured numbers are in the table below.

Hybrid, vector and semantic search side by side

Full-text (BM25)Vector searchSemantic searchHybrid search
Ranks byQuery terms in the document, their rarity, document lengthCloseness of embeddingsMeaning, almost always through vectorsBoth lists, fused
Strong onExact names, IDs, error stringsParaphrases, loose questionsParaphrases, loose questionsBoth kinds in one result list
NeedsAn inverted indexEmbeddings and a vector indexSame as vector searchBoth, plus a fusion step
Typical useLogs, code, product codesRecommendations, "more like this"Natural language search fieldsRAG, AI agents, mixed queries
Try it: three ways to rank

Hybrid, vector, and semantic search

Two lists, then a merge

A hybrid query runs a full-text arm, such as BM25, and a vector arm on the same question, then fuses the ranks. You keep exact names and close meanings in one list.

This comparison is a teaching account, not a new benchmark. Measured hybrid scores stay on the hybrid-search how-to and the published quality answers.

How vector search works

Vector search turns the query and each passage into an embedding, a list of numbers that stands for meaning. Passages whose vectors sit close to the query vector rank first. That is how a question like "server unreachable" can reach a passage that says "connection refused". The model choice matters: the same index gives different results with a different embedder.

Vector search is weaker where two items differ by one character, such as two product codes or two function names. Their embeddings sit close together, so the wrong one can rank first. The concept page is semantic search.

How semantic search relates to vector search

Semantic search is the name for ranking by meaning instead of by exact words. In practice the method behind it is almost always a vector query. Product pages often use the two names for the same thing. This page keeps both phrases because people search for both.

How hybrid search works

Hybrid search runs a full-text arm and a vector arm on the same question. Each returns a ranked list. A fusion step merges them into one list. The common choice is reciprocal rank fusion, which adds 1 / (k + rank) for every list a document appears in, with k = 60 in the original paper. It uses ranks, not raw scores, so a BM25 score and a cosine similarity never have to share a scale. The formula and a calculator are on the reciprocal rank fusion page.

Fusion also helps recall. A passage that only the vector arm found still reaches the fused list, and so does a passage that only BM25 found. For a RAG pipeline or an AI agent, that means fewer questions where the right passage never reaches the model.

Measured: hybrid vs vector vs BM25 on BEIR

XERJ ran BM25, vectors only, a reorder arm and hybrid RRF on two public BEIR datasets. Hybrid RRF ranked first on both. On SciFact it scored nDCG@10 0.6993, against 0.6764 for vectors only and 0.6572 for BM25. On NFCorpus it scored 0.3448, against 0.3291 for vectors and 0.3016 for BM25. BM25 found no hits for 25 of the 323 NFCorpus queries, and the hybrid arm still returned results for every one of them.

Try it: switch datasets

BM25, vectors and hybrid on two public BEIR datasets

SciFact: 300 test queries over 5,183 documents

ArmnDCG@10Queries with no hits
BM250.65720
Vectors only (MiniLM)0.67640
BM25 top 30 reordered by MiniLM0.68550
Hybrid RRF0.69930
Runs in your browser and sends nothing. Measured by XERJ with --embed-mode neural and the built-in all-MiniLM-L6-v2 model; the default lexical embedder is not covered. Raw output is in benchmarks/beir-hybrid/results in the XERJ repository.

These runs used --embed-mode neural with the built-in all-MiniLM-L6-v2 model. The default XERJ embedder is lexical and runs offline, and these vector figures do not apply to it. The full method is on hybrid search quality, measured with nDCG.

Run hybrid search on your own folder

  1. Install: curl -fsSL https://xerj.org/get | sh
  2. Start a local node with neural embeddings: xerj --embed-mode neural
  3. Index a folder: xerj autoindex ./docs --url http://127.0.0.1:9200 --progress plain
  4. Send one request with a match query, a knn query and "fusion":"rrf". The full request is in the command list on this page.

Every command has a copy button. To hand the work to an agent, use Copy the prompt and paste it into Claude Code, Cursor or Codex. The agent runs the same question three ways and shows you what hybrid search adds. The step-by-step how-to is how to run hybrid search in XERJ.

How XERJ uses it

XERJ answers a full-text query with BM25 by default. Neural or hybrid mode adds a vector arm, and both live in the same index, so there is no separate vector database to run. Agents reach the same search through xerj mcp. A side-by-side of the two arms is BM25 vs vector search, and a RAG setup without a separate vector store is RAG without a vector database.

History and research

Dense vector retrieval is described by Karpukhin and colleagues in Dense Passage Retrieval for Open-Domain Question Answering (EMNLP 2020). BM25 is surveyed by Robertson and Zaragoza in The Probabilistic Relevance Framework: BM25 and Beyond (2009). Fusion is described by Cormack, Clarke and Buettcher in Reciprocal Rank Fusion outperforms Condorcet and individual Rank Learning Methods (SIGIR 2009). Those papers are research sources, not XERJ measurements.

Related terms

Hybrid search, BM25, semantic search, reciprocal rank fusion and vector database vs full-text search.

FAQ

Is hybrid search better than vector search?

On the two BEIR datasets XERJ measured, yes. Hybrid RRF scored nDCG@10 0.6993 against 0.6764 for vectors alone on SciFact, and 0.3448 against 0.3291 on NFCorpus. Test it on your own queries before you decide.

Is semantic search the same as vector search?

In practice, almost always. Semantic search means ranking by meaning, and the usual method is a vector query over embeddings. Some writers use the two names for the same thing.

What does hybrid search add to vector search?

A full-text arm, such as BM25, and a fusion step. Exact names, codes and error strings rank well through BM25, close meanings rank well through vectors, and the fused list keeps both.

Should I use hybrid search for RAG?

It is the safer default for RAG, because user questions mix exact terms and loose wording. A passage that only one arm finds can still reach the model.

When is vector search alone enough?

When queries are loose paraphrases over short texts and exact identifiers rarely matter, such as recommendations or a 'more like this' feature.

When is BM25 alone enough?

When almost every query is an exact identifier, a name or an error string. BM25 is also the fastest of the three.

Do I need a vector database for hybrid search?

No. You need one place that holds an inverted index and vectors. XERJ keeps both in the same index and fuses them inside one request.

Evidence

Related