Worked examples for replaying hybrid search rankings
Reciprocal rank fusion, or RRF, combines ordered search results by adding a contribution for each list where an item appears. These examples use invented rankings and exact arithmetic. Original RRF paper
Download the five replays and saved results (ZIP). Extract the files and follow the README to run them with Python 3.
Keeping two ranks from one search instead of one gives A another contribution and moves it ahead of B. Every item stays in the combined list. Cutting the final output to one result still returns A after the full fusion. The input limit controls contributions. The output limit controls what the reader sees.
What does the rank constant change?
A has two first-place ranks. B has one first-place rank and two twelfth-place ranks. A leads for positive constants below 10, ties with B at 10, and falls behind when the constant is above 10. Use the same tie-breaking rule when you replay the result.
Did a search list count twice?
In the weighted sum, including an exact copy with its own full weight has the same effect as adding that weight to the original list. Splitting the original weight between the two copies preserves each item's score. Multiplying every weight by the same positive factor preserves the order.
What happens when both settings change?
The word-based list is A, C, B, D. The meaning-based list is B, A, D, C. Each included list has weight one and the rank constant is 60. At depth one, B wins whether the meaning-based list is counted once or twice. At depth two, A wins when that list is counted once and B wins when it is counted twice. Comparing only the first and last setups would show B winning in both. Replay one change at a time to see what caused the difference.
When do passages become documents?
Two different passages from document A come first in the two search lists. The same passage from B comes second in both. Grouping passages into documents before merging the lists puts A first. Merging by passage and then ranking each document by its highest-scoring passage puts B first. Both outputs contain the same four documents.