Skip to content

Score Boosting (BOOST)

The BOOST clause applies a mathematical expression to modify each result's score. Expressions are compiled to Qdrant's Score Builder API and evaluated server-side — no client-side post-processing.

For the complete operator reference (variables, arithmetic, math functions, decay functions, geo-distance, datetime, CASE WHEN, DEFAULTS), see the BOOST Expression Reference.

QUERY '<text>' FROM <collection> LIMIT <n>
BOOST (<expression>)
[DEFAULTS (key = value, ...)]
  1. *, / (highest)
  2. +, -
  3. Comparison operators (=, >, <, etc.)
  4. NOT
  5. AND
  6. OR (lowest)

Parentheses override precedence.

QUERY 'emergency triage' FROM docs LIMIT 10
USING HYBRID
BOOST (
$score
+ exp_decay(datetime_key('updated_at'), target=datetime('2026-01-01T00:00:00Z'), scale=86400)
+ CASE WHEN priority = 'critical' THEN 0.5 ELSE 0 END
)

Three signals combined in one pass: similarity score, recency decay, and priority bonus.

Different scoring logic for different categories — premium content gets a 2× boost, deprecated content gets penalized.

QUERY 'kubernetes best practices' FROM documentation LIMIT 15
BOOST (
CASE WHEN category = 'premium' THEN $score * 2.0
ELSE CASE WHEN status = 'deprecated' THEN $score * 0.5
ELSE $score END END
)
WITH
dense AS (QUERY 'transformer attention mechanism' USING dense LIMIT 200 WHERE year >= 2020),
sparse AS (QUERY 'transformer attention mechanism' USING sparse LIMIT 200)
QUERY 'transformer attention mechanism' FROM papers LIMIT 10
PREFETCH (dense SCORE THRESHOLD 0.5, sparse SCORE THRESHOLD 0.3)
FUSION RRF
WITH (rrf_k = 20, rrf_weights = [0.6, 0.4])
BOOST (
$score + 0.2 * CASE WHEN venue IN ('NeurIPS', 'ICML', 'ICLR') THEN 1.0 ELSE 0.0 END
)
QUERY 'kubernetes deployment' FROM incidents LIMIT 10
BOOST (
CASE WHEN priority = 'critical' THEN $score * 2.0
ELSE $score END
)

Boost results by proximity using GEO_DISTANCE and GAUSS_DECAY:

QUERY 'italian restaurant' FROM restaurants LIMIT 10
BOOST (
$score * gauss_decay(
geo_distance({'lat': 48.8566, 'lon': 2.3522}, location),
scale=5000,
midpoint=0.5
)
)

For efficient geo filtering (not just boosting), create a geo index:

CREATE INDEX ON restaurants FOR location TYPE geo

Prioritize recent content with exponential datetime decay:

QUERY 'kubernetes deployment' FROM articles LIMIT 10
BOOST (
$score + exp_decay(
datetime_key('published_at'),
target=datetime('2026-01-01T00:00:00Z'),
scale=86400,
midpoint=0.5
)
)

scale=86400 = 1 day in seconds. After 1 day, the decay reaches midpoint=0.5.

Using gaussian decay for a smoother falloff:

QUERY 'annual report' FROM reports LIMIT 10
BOOST (
$score * gauss_decay(
datetime_key('published_at'),
target: datetime('2026-01-01T00:00:00Z'),
scale: 30d,
midpoint: 0.5
)
)

Combine hybrid retrieval, MMR diversity, time freshness, and conditional scoring in a single statement:

QUERY 'emergency triage' FROM docs LIMIT 10
USING HYBRID
WITH (mmr_diversity = 0.5, mmr_candidates = 100)
BOOST (
$score
+ exp_decay(datetime_key('updated_at'), target=datetime('2026-01-01T00:00:00Z'), scale=86400)
+ CASE WHEN priority = 'critical' THEN 0.5 ELSE 0 END
)

Extended version with CTE prefetch, per-leg filters, multi-branch conditional, and GROUP BY diversity:

WITH
dense AS (QUERY 'emergency triage' USING dense LIMIT 200 WHERE status = 'active'),
sparse AS (QUERY 'emergency triage' USING sparse LIMIT 300)
QUERY 'emergency triage' FROM docs LIMIT 10
PREFETCH (
dense SCORE THRESHOLD 0.5,
sparse SCORE THRESHOLD 0.3
)
FUSION RRF
WITH (rrf_k = 20, rrf_weights = [0.65, 0.35])
BOOST (
$score
+ exp_decay(datetime_key('updated_at'), target=datetime('2026-01-01T00:00:00Z'), scale=86400)
+ CASE WHEN priority = 'critical' THEN 0.5
ELSE CASE WHEN priority = 'high' THEN 0.2
ELSE 0 END END
)
GROUP BY 'department'
GROUP_SIZE 3

Required indexes for the extended query:

CREATE INDEX ON docs FOR status TYPE keyword
CREATE INDEX ON docs FOR priority TYPE keyword
CREATE INDEX ON docs FOR department TYPE keyword