Hybrid search combines dense (semantic) and sparse (BM25 keyword) retrieval using Reciprocal Rank Fusion (RRF) or Distribution-Based Score Fusion (DBSF).
Basic Hybrid Search
Section titled “Basic Hybrid Search”QUERY 'emergency care' FROM docs LIMIT 5 USING HYBRIDThis runs dense and sparse queries in parallel and merges results with RRF.
Fusion Modes
Section titled “Fusion Modes”RRF (default):
QUERY 'vector database' FROM docs LIMIT 10 USING HYBRIDDBSF:
QUERY 'vector database' FROM docs LIMIT 10 USING HYBRID FUSION DBSFParameterized RRF:
QUERY 'vector database' FROM docs LIMIT 10 USING HYBRID WITH (rrf_k = 30, rrf_weights = [0.7, 0.3])| Parameter | Default | Description |
|---|---|---|
rrf_k | 60 | Rank penalty constant — lower values make top-ranked items dominate more |
rrf_weights | [0.5, 0.5] | Per-leg weights — [dense_weight, sparse_weight] |
With Filters
Section titled “With Filters”QUERY 'emergency care' FROM docs LIMIT 10 USING HYBRID WHERE status = 'active' AND year >= 2024MMR Diversity
Section titled “MMR Diversity”Apply Maximal Marginal Relevance to reduce redundant results in the dense leg:
QUERY 'emergency care' FROM docs LIMIT 10 USING HYBRID WITH (mmr_diversity = 0.5, mmr_candidates = 100)| Parameter | Description |
|---|---|
mmr_diversity | 0..1 — higher = more diverse |
mmr_candidates | Candidate pool size before MMR selection |
Dense-Only / Sparse-Only
Section titled “Dense-Only / Sparse-Only”Dense only:
QUERY 'vector database' FROM docs LIMIT 10 USING DENSESparse (BM25) only:
QUERY 'vector database' FROM docs LIMIT 10 USING SPARSEReranking (Cloud)
Section titled “Reranking (Cloud)”Apply cross-encoder reranking after hybrid retrieval (Qdrant Cloud only):
QUERY 'emergency care' FROM docs LIMIT 10 USING HYBRID RERANKMulti-Stage Hybrid with CTEs
Section titled “Multi-Stage Hybrid with CTEs”For fine-grained control over each retrieval leg:
WITH dense AS (QUERY 'vector database performance' USING dense LIMIT 200 WHERE category = 'tech' AND published_at >= '2025-01-01'), sparse AS (QUERY 'vector database performance' USING sparse LIMIT 300)QUERY 'vector database performance' FROM articles LIMIT 10 PREFETCH ( dense SCORE THRESHOLD 0.6, sparse SCORE THRESHOLD 0.3 ) FUSION RRF WITH (rrf_k = 20, rrf_weights = [0.6, 0.4])For full CTE patterns, see the Multi-Stage Retrieval guide.
Tuned RRF
Section titled “Tuned RRF”Production hybrid search with per-prefetch filters and weighted RRF fusion:
WITH dense AS ( QUERY 'vector database performance' USING dense LIMIT 200 WHERE category = 'tech' AND published_at >= '2025-01-01' ), sparse AS ( QUERY 'vector database performance' USING sparse LIMIT 300 )QUERY 'vector database performance' FROM articles LIMIT 10 PREFETCH ( dense SCORE THRESHOLD 0.6, sparse SCORE THRESHOLD 0.3 ) FUSION RRF WITH (rrf_k = 20, rrf_weights = [0.6, 0.4])| Decision | Why |
|---|---|
| Dense prefetch filtered to recent tech | Higher precision leg |
| Sparse prefetch has no filter | Wider keyword net |
rrf_weights = [0.6, 0.4] | Favors the semantic leg |
rrf_k = 20 (default: 60) | Steeper rank penalty — top-ranked items dominate more |
SCORE THRESHOLD per leg | Prune low-quality candidates before fusion |
Complete Clause Reference
Section titled “Complete Clause Reference”QUERY '<text>' FROM <collection> [USING HYBRID [FUSION DBSF]] [WITH (rrf_k = <n>, rrf_weights = [<f>, <f>])] [WITH (mmr_diversity = <f>, mmr_candidates = <n>)] [WITH (hnsw_ef = <n>)] [WITH (acorn = true)] [WITH (exact = true)] [WHERE <filter>] [RERANK] [GROUP BY '<field>' [GROUP_SIZE <n>]] [SCORE THRESHOLD <float>] [LIMIT <n>] [OFFSET <n>]