Database / Milvus Vector database Interview questions
How does Milvus's hybrid search combine dense and sparse vector results?
Hybrid search runs separate approximate nearest neighbor searches against each configured vector field (typically one dense, one sparse), retrieving a candidate list from each independently, and then combines those separate ranked lists into one final result using a configurable reranking strategy.
from pymilvus import RRFRanker results = client.hybrid_search( collection_name="documents", reqs=[dense_request, sparse_request], ranker=RRFRanker(k=60), limit=10 )
Two common reranking strategies serve different needs: Weighted Ranker combines each list's scores using configurable weights (like 0.7 for dense, 0.3 for sparse), useful when one signal should generally dominate but the other should still meaningfully contribute. Reciprocal Rank Fusion (RRF) instead combines results based purely on each item's rank position in each list (not the raw scores, which aren't necessarily on comparable scales between dense and sparse search), which avoids the problem of needing to carefully calibrate weights across two fundamentally different scoring systems.
The choice between them typically depends on whether an application has a principled reason to weight one signal over the other (favoring Weighted Ranker) or wants a more robust, less manually-tuned default that works reasonably well without careful score calibration (favoring RRF).
More Related questions...