Clarity before claims.A method you can inspect
A practical guide

What Is RRF in RAG? Align Document IDs Before You Fuse Two Search Lists

Follow a three-document fixture to see how reciprocal rank fusion combines list positions and why shared result IDs matter.

By My AI Search Report editorial team
Two stacks of pale index cards sit beside one another, with matching blue tabs.
Decide what will count as the same result across both lists.
My AI Search ReportMy AI Search Report

At a glance

Reciprocal rank fusion combines results by list position. Decide how your pipeline identifies the same document or chunk across result lists before you add the contributions.

Compare fusion with the next reranking stage

Reciprocal rank fusion combines several ranked result lists. In a retrieval-augmented generation system, that can bring text-search and vector-search results into one order before later stages choose context. A result that appears in both lists can receive a contribution from each, provided the system recognizes it as the same item.

Read contributions from rank positions

In this example, each appearance contributes one divided by its rank plus a constant. Use 60 as the constant and count the first position as rank one. A result at rank one contributes 1/61. A result at rank two contributes 1/62. The original text and vector scores do not have to use the same numeric scale.

Record the list positions that were actually passed into the fuse step. A result outside a configured retrieval window may not contribute, even if the larger index would have returned it farther down.

Text ranks A first and B second. Vector ranks C first and B second.
Keep the rank positions that entered the fuse step.

For the rank-based contribution formula, see Hybrid Search Scoring: Reciprocal Rank Fusion.

Sources: Microsoft · Elastic

Choose a shared result unit

Decide whether your app returns documents, chunks or another stable unit. If one system returns whole documents and the other returns passages, map both to the unit your pipeline needs before interpreting a combined result. Do this with known source metadata. Two entries with similar titles may still refer to different pages or different editions.

If your app returns passages, two chunks from one page can stay separate. If it returns documents, decide how to handle several chunks from the same document in one list. Keep that decision visible when comparing retrieval runs.

Two clipped stacks of cards sit next to a closed navy notebook.
Keep the original result identifier and the mapping together.

Sources: Microsoft · Elastic

Run the same result with aligned and split IDs

Use two fictional lists. Text returns A then B. Vector returns C then B. A and C contribute 1/61 each. The matched B earns 1/62 twice, or 2/62. B comes first. If the system instead receives B-text and B-vector and treats them as separate identifiers, each earns one 1/62 contribution. A and C both remain ahead.

Keep the query, list positions and constant the same during this comparison. That isolates the effect of the identity mapping.

Fictional rank lists with k set to 60.
ResultText rankVector rankCombined score
A1Absent1/61
B222/62
CAbsent11/61
One shared B gets two contributions. Split B identities each receive one contribution.
Check result identity before explaining the fused order.

The second result appears in both lists

Shared identifier

B gets 1/62 from both lists. The two contributions put it ahead of A and C in the fixture.

Separate identifiers

B-text and B-vector each get 1/62. They sit below the two first-ranked entries.

For another worked fusion list, see Reciprocal Rank Fusion.

Sources: Microsoft · Elastic

Check what the fused order is used for

After fusion, inspect the actual passages that the next stage receives. If a particular claim needs evidence, verify that the selected passage supports it. Record the candidate identity, rank and downstream source text in separate fields. The list order helps explain which sources were considered during retrieval.

A record stores the result unit, input identifiers and actual source evidence independently.
Explain ranking before interpreting the passage itself.

Verify the combined list

  • Pick a consistent result unit.
  • Map IDs using known metadata.
  • Record contributions from both lists.
  • Review the fetched source text separately.

For where this step fits in a RAG workflow, see Develop a RAG Solution on Azure: Information Retrieval.

For the related task, see Review retrieval-augmented generation.

Sources: Microsoft

Frequently asked questions

Do the original similarity scores get averaged?

RRF uses positions in ranked lists. The original scoring methods can use different scales.

Should chunks from the same URL always be combined?

Decide what the pipeline returns. At chunk level, two passages on the same page can be separate results. At document level, use a verified mapping and an explicit ranking rule.

Does a high fused result prove its contents support the answer?

The score orders retrieval candidates. Open the retrieved text and compare it to the claim before treating it as evidence.

Does the example select a correct k for every system?

The chosen value makes the example reproducible. Check your implementation and retrieval objective before comparing configurations.

My AI Search ReportMy AI Search Report

Read how fusion differs from reranking

Keep the candidate combination separate from the next ranking stage.

Compare fusion with the next reranking stage

Continue with a related guide

References

My AI Search Report newsletter

Get practical guides to AI search, from making pages easier to crawl to checking the evidence behind an answer.