Database / Qdrant Vector DB Interview questions
Explain hybrid search using the Query API and Prefetch?
Qdrant's Query API supports hybrid search through prefetch stages: multiple independent sub-queries (for example, one dense vector search and one sparse vector search) run first, and their results are then combined by an outer fusion query into one final ranked list.
results = client.query_points( collection_name="documents", prefetch=[ models.Prefetch(query=sparse_query_vector, using="sparse", limit=20), models.Prefetch(query=dense_query_vector, using="dense", limit=20), ], query=models.FusionQuery(fusion=models.Fusion.RRF), limit=10, )
Each Prefetch entry specifies its own query, which named vector to search against (using), and how many candidates to retrieve; the outer query then specifies a fusion method — commonly Reciprocal Rank Fusion (RRF) or Distribution-Based Score Fusion (DBSF) — that merges the prefetch stages' separate ranked lists into one combined ranking.
Because prefetch stages can themselves be nested, this same mechanism supports more elaborate pipelines beyond simple two-way fusion — retrieving a broad candidate set cheaply with a lower-dimensional or sparse representation, then reranking that smaller set with a more expensive, higher-fidelity model — giving a lot of flexibility to balance retrieval quality against latency within a single query request.
More Related questions...