Skip to content

Hybrid retrieval

Hybrid retrieval combines semantic dense similarity with lexical sparse matching. QQL exposes a shorthand and an explicit multi-stage form.

QQLSchema-resolved hybrid searchTry in playground
QUERY HYBRID TEXT 'zero downtime deployment' DENSE dense SPARSE sparse FUSION RRF
FROM runbooks
WHERE service = 'gateway'
LIMIT 10;

If the collection has exactly one dense and one sparse vector, omit the names:

QQLHybrid defaultsTry in playground
QUERY HYBRID TEXT 'zero downtime deployment' FUSION RRF FROM runbooks LIMIT 10;
QQLWeighted RRF pipelineTry in playground
WITH
semantic AS (QUERY 'zero downtime deployment' USING dense WHERE service = 'gateway' LIMIT 120),
lexical AS (QUERY 'zero downtime deployment' USING sparse WHERE service = 'gateway' LIMIT 180)
QUERY FUSION RRF
FROM runbooks
PREFETCH (semantic, lexical)
PARAMS (rrf_k = 40, rrf_weights = [0.7, 0.3])
LIMIT 10;

Use the explicit form when candidate limits, filters, or weights differ by stage. rrf_weights length must equal the prefetch count.

USING bm25 without an explicit model resolves to the server-side Qdrant/bm25 model — queries embed with unit weights and documents with tf saturation, staying wire-compatible with Qdrant's qdrant/bm25:

QQLbm25 defaultsTry in playground
QUERY 'zero downtime deployment' FROM runbooks USING bm25 LIMIT 10;
FusionPrefer when
RRFRanking positions are reliable but score scales differ
DBSFNormalized score magnitude carries useful information