Hybrid retrieval combines semantic dense similarity with lexical sparse matching. QQL exposes a shorthand and an explicit multi-stage form.
Shorthand
Section titled “Shorthand”QUERY HYBRID TEXT 'zero downtime deployment' DENSE dense SPARSE sparse FUSION RRFFROM runbooksWHERE service = 'gateway'LIMIT 10;If the collection has exactly one dense and one sparse vector, omit the names:
QUERY HYBRID TEXT 'zero downtime deployment' FUSION RRF FROM runbooks LIMIT 10;Explicit candidate stages
Section titled “Explicit candidate stages”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 RRFFROM runbooksPREFETCH (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:
QUERY 'zero downtime deployment' FROM runbooks USING bm25 LIMIT 10;RRF or DBSF?
Section titled “RRF or DBSF?”| Fusion | Prefer when |
|---|---|
| RRF | Ranking positions are reliable but score scales differ |
| DBSF | Normalized score magnitude carries useful information |