Embedding-Based Retrieval and Vector Search
Hybrid search combines term-based retrieval with embedding-based retrieval, and the two can be arranged in sequence or in parallel as an ensemble.
When One Word Is Not Enough
Imagine you search a large document collection for the word transformer. A keyword search will return every page that contains that word. Some of those pages may describe an electrical device, some may describe a neural network design, and some may be about a film. The word matched, yet the meaning you wanted may be missing from the results. A search system that depends on only one retrieval method inherits that method's weakness, and no single method is free of blind spots.
What do you think happens?
When a keyword search for the word transformer returns a page about an electrical device, what has the search actually checked?
Reveal answer
Whether the page contains the word transformer
A keyword method matches the literal word. It does not check whether the surrounding meaning is the one you wanted, which is why the electrical-device page can appear in the results.
The practical response is to combine retrieval methods so that each one covers for the other's blind spots. The source states the motivation directly: each retrieval algorithm has its own advantages, so a production retrieval system typically combines several approaches rather than committing to one. The rest of this article explains the two main ways of combining them.
What Hybrid Search Combines
Hybrid search combines term-based retrieval with embedding-based retrieval. The phrase describes the combination itself, not a single algorithm. Once you accept that, the real design question is how the two methods are arranged.
The source identifies two arrangements. In a sequential arrangement, different algorithms are used in a chain, where one feeds the next. In a parallel arrangement, often called an ensemble, several algorithms run on the same query and their outputs are merged. The next two sections follow each arrangement in turn, starting with the chain.
Sequential Retrieval: Cheap Then Precise
In a sequential arrangement, the first retriever is chosen for being cheap and reasonably good at finding a broad set of candidates, even if it is not very precise. The source gives a term-based system as the example of this first step. The second retriever is chosen for being more precise, even though it costs more to run. The key point is that the second retriever only needs to look at the candidates the first step produced. That restriction is what makes its expense affordable.
What do you think happens?
After the cheap step passes its candidates forward, does the expensive second step search the entire collection again?
Reveal answer
No, it only examines the candidates the first step produced
The second step does not search from scratch. It reorders the candidates that already exist, so the expensive work is applied to a much smaller set.
The second step in this chain has a specific name: reranking. Reranking reorders the candidates that already exist so that the ones actually related to the query rise to the top. Each stage hands a smaller and more relevant set forward, so the expensive step never has to examine the entire collection.
The source offers a second chain with a different shape. Suppose the query is 'Who is responsible for the most sales to X?' The first step uses the keyword X to fetch all documents associated with that customer. The second step then uses vector search to pull out the context matching the question about who is responsible for the most sales. Here the keyword step narrows the collection by an exact identifier, and the vector step handles the open-ended part of the question.
Parallel Retrieval as an Ensemble
The other arrangement does not chain the algorithms. Instead, several retrievers receive the same query at the same time, and each produces its own ranking of documents. A retriever works by ranking documents according to their relevance scores for the query, so each retriever's output is a ranked list. The retrievers never see each other's output while they work. They are independent, which is why they can run together.
The diagram makes one point clear: the merging happens after the retrievers finish. Because each retriever returns its own ranked list, the remaining task is to combine those lists into one final ranking. The source names one combination method for this job, reciprocal rank fusion.
Scoring Positions with Reciprocal Rank Fusion
Reciprocal rank fusion, abbreviated RRF, is the algorithm the source gives for combining different rankings. It does not look at the raw relevance scores each retriever produced. It looks only at where each document landed in each list. Each document receives a score based on its rank from a given retriever, and the higher the document ranks, the higher that score is.
Under this rule, a document ranked first receives $\frac{1}{1} = 1$, and a document ranked second receives $\frac{1}{2} = 0.5$. A document ranked third receives $\frac{1}{3}$, which is about 0.333. The score falls as the rank number grows. Because the rule depends only on position, a retriever whose raw scores are on a different scale from another retriever's can still be combined with it, without first converting both scales to a common unit.
Fusing Two Rankings by Hand
Fusing a term-based ranking with an embedding-based ranking
Two retrievers rank the same five documents for one query. Ranking A comes from a term-based retriever and lists D1, D2, D3, D4 in that order. Ranking B comes from an embedding-based retriever and lists D3, D1, D5, D2 in that order. Compute the RRF score of each document in each ranking, add the scores for each document, and give the fused order.
- 1Read the positions in ranking A
D1 is at rank 1, D2 at rank 2, D3 at rank 3, and D4 at rank 4. D5 does not appear in ranking A.
- 2Score ranking A
D1 scores $\frac{1}{1} = 1$, D2 scores $\frac{1}{2} = 0.5$, D3 scores $\frac{1}{3} \approx 0.333$, and D4 scores $\frac{1}{4} = 0.25$.
- 3Read the positions in ranking B
D3 is at rank 1, D1 at rank 2, D5 at rank 3, and D2 at rank 4. D4 does not appear in ranking B.
- 4Score ranking B
D3 scores $\frac{1}{1} = 1$, D1 scores $\frac{1}{2} = 0.5$, D5 scores $\frac{1}{3} \approx 0.333$, and D2 scores $\frac{1}{4} = 0.25$.
- 5Add each document's scores
D1 gets $1 + 0.5 = 1.5$. D3 gets $0.333 + 1 = 1.333$. D2 gets $0.5 + 0.25 = 0.75$. D5 appears only in ranking B, so it gets $0.333$. D4 appears only in ranking A, so it gets $0.25$.
- 6Sort by the total
Sorting the totals from highest to lowest gives D1 (1.5), D3 (1.333), D2 (0.75), D5 (0.333), and D4 (0.25).
The fused ranking is D1, D3, D2, D5, D4. D1 leads because it ranks first in one list and second in the other.
Notice why D1 beats a document that ranks first in only one list. A document ranked first in one list and absent from the other gets only its single score. A document that appears near the top of both lists collects two contributions, so the total grows. This is why agreement between retrievers is rewarded.
Term Matching Versus Meaning Matching
The two retrievers in the ensemble above are chosen for different strengths. A term-based method matches the words in the query against the words in documents. An embedding-based method compares vectors, so that a query and a document can be matched through their representation rather than only through shared words. The source's keyword example shows where word matching falls short: the word matched, yet the intended meaning may be missing.
Mistakes Beginners Make with Hybrid Search
Common mistake Treating hybrid search as a single algorithm
Why it failsThe source describes hybrid search as the combination itself. The design question is how the methods are arranged, in sequence or in parallel.
Do this insteadName the two retrieval approaches being combined and the arrangement used.
Common mistake Assuming the second step in a sequential chain searches the whole collection
What it looks likeBelieving the reranker scans every document again after the cheap retriever has finished.
Why it failsReranking reorders the candidates that already exist. It does not search from scratch.
Do this insteadTrace the candidate set stage by stage, noting how it shrinks and what each stage does to it.
Common mistake Merging rankings by adding raw relevance scores
Why it failsRRF looks only at where each document landed in each list, not at the raw scores each retriever produced.
Do this insteadConvert each position to a score using its rank, then combine those per-ranking scores.
Common mistake Presenting the summing step as the source's stated rule
Why it failsThe source gives the per-position score and says the combined ranking comes from the rankings together. It does not spell out the adding step.
Do this insteadLabel the summing step as an illustration when you explain it.
Practice: Fusing a New Pair of Rankings
Using the two rankings from the worked example, Ranking A (D1, D2, D3, D4) and Ranking B (D3, D1, D5, D2), compute the fused RRF total for D2 and for D4. State which of the two ranks higher in the fused order.
Hints
- Find D2's rank in ranking A and its rank in ranking B before computing any score.
- D4 appears only in ranking A, so it has only one per-ranking score.
- A position of 4 gives a score of one quarter, which is 0.25.
Key Takeaways
- Hybrid search is the combination of term-based retrieval and embedding-based retrieval, arranged either in sequence or in parallel as an ensemble.
- In a sequential arrangement, a cheap, less precise retriever fetches candidates and a more precise, more expensive step reranks them, reordering candidates without searching from scratch.
- In a parallel arrangement, several retrievers rank documents for the same query independently, and their separate rankings must be merged into one final ranking.
- Reciprocal rank fusion scores each document by its position in each ranking, with first place giving 1, second place giving 0.5, and the score falling as rank increases.
- Documents that rank well in several lists accumulate more score, so agreement between retrievers is rewarded in the fused ranking.