Overview
The Rank Fusion feature of Fess integrates multiple search results to provide more accurate search results.
What is Rank Fusion
Rank Fusion is a technique that combines results from multiple search algorithms or scoring methods to generate a single optimized ranking.
Key benefits:
Combines the strengths of different algorithms
Improves search accuracy
Provides diverse search results
Supported Algorithm
Fess uses the RRF (Reciprocal Rank Fusion) algorithm for Rank Fusion.
RRF (Reciprocal Rank Fusion)
RRF calculates scores by summing the reciprocal of each result’s rank.
Formula:
score(d) = Σ 1 / (k + rank(d))
k: Rank constant parameter (default: 20)rank(d): Rank of document d in each search result
Settings
fess_config.properties
Configuration properties:
# Window size for rank fusion
rank.fusion.window_size=200
# Rank constant (k parameter for RRF)
rank.fusion.rank_constant=20
# Number of threads (-1 for auto)
rank.fusion.threads=-1
# Score field name in results
rank.fusion.score_field=rf_score
| Property | Default | Description |
|---|---|---|
rank.fusion.window_size | 200 | Number of results to consider from each search type for fusion |
rank.fusion.rank_constant | 20 | The k constant in the RRF formula; controls how much weight is given to lower-ranked results |
rank.fusion.threads | -1 | Number of threads for parallel execution (-1 for automatic) |
rank.fusion.score_field | rf_score | Field name used to store the computed rank fusion score |
Usage Examples
Basic Hybrid Search
Calculate BM25 score with keyword search
Calculate vector similarity with semantic search
Fuse both results with RRF
Generate final ranking
Search Flow:
User Query
↓
┌──────────────────┬──────────────────┐
│ Keyword Search │ Semantic Search │
│ (BM25) │ (Vector) │
└────────┬─────────┴────────┬─────────┘
↓ ↓
Rank List 1 Rank List 2
└────────┬─────────┘
↓
Rank Fusion (RRF)
↓
Final Ranking
Performance Considerations
Adjust
rank.fusion.window_sizeto balance quality and speed; larger values consider more candidates but use more memorySet
rank.fusion.threadsto control parallelism;-1automatically determines the thread countMemory usage increases with larger window sizes as more search results are retained
Troubleshooting
Search Results Differ from Expectations
Symptom: Results after Rank Fusion differ from expectations
Checks:
Verify results from each search type individually
Adjust the
rank.fusion.rank_constantvalueAdjust
rank.fusion.window_sizeto include more candidate results
Out of Memory
Symptom: OutOfMemoryError occurs
Solutions:
Reduce
rank.fusion.window_sizeIncrease JVM heap size
Disable unnecessary search types
Reference
Scripting Overview - Scripting Overview
../admin/search-settings - Search Settings Guide
LLM Integration Overview - LLM Integration Guide (Semantic Search)