Skip to content

Hybrid Search

Hybrid search combines dense (semantic) and sparse (BM25 keyword) retrieval using Reciprocal Rank Fusion (RRF) or Distribution-Based Score Fusion (DBSF).

QUERY 'emergency care' FROM docs LIMIT 5 USING HYBRID

This runs dense and sparse queries in parallel and merges results with RRF.

RRF (default):

QUERY 'vector database' FROM docs LIMIT 10 USING HYBRID

DBSF:

QUERY 'vector database' FROM docs LIMIT 10 USING HYBRID FUSION DBSF

Parameterized RRF:

QUERY 'vector database' FROM docs LIMIT 10 USING HYBRID WITH (rrf_k = 30, rrf_weights = [0.7, 0.3])
ParameterDefaultDescription
rrf_k60Rank penalty constant — lower values make top-ranked items dominate more
rrf_weights[0.5, 0.5]Per-leg weights — [dense_weight, sparse_weight]
QUERY 'emergency care' FROM docs LIMIT 10
USING HYBRID
WHERE status = 'active' AND year >= 2024

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)
ParameterDescription
mmr_diversity0..1 — higher = more diverse
mmr_candidatesCandidate pool size before MMR selection

Dense only:

QUERY 'vector database' FROM docs LIMIT 10 USING DENSE

Sparse (BM25) only:

QUERY 'vector database' FROM docs LIMIT 10 USING SPARSE

Apply cross-encoder reranking after hybrid retrieval (Qdrant Cloud only):

QUERY 'emergency care' FROM docs LIMIT 10 USING HYBRID RERANK

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.

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])
DecisionWhy
Dense prefetch filtered to recent techHigher precision leg
Sparse prefetch has no filterWider 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 legPrune low-quality candidates before fusion
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>]