Reference · Cheat sheet
The compressed essence. Print it, pin it.
IDF(t) = ln(1 + (N − n + 0.5) / (n + 0.5))
| Part | Says | In the formula |
|---|---|---|
| IDF | Rare terms matter more | ln(1 + (N−n+0.5)/(n+0.5)) |
| TF saturation | Repetition helps, with diminishing returns | fraction → ceiling (k1+1) |
| Length norm. | Short fields count more | b · |D|/avgdl in denominator |
| Knob | Default | Controls | Extremes |
|---|---|---|---|
k1 | 1.2 | TF saturation rate | 0 = ignore frequency; higher = saturate slower |
b | 0.75 | Length normalization | 0 = ignore length; 1 = full penalty |
N/n are shard-local → scores can differ by shard. Use search_type=dfs_query_then_fetch for global stats._score is unbounded and only comparable within one query + index.classic similarity).filter / constant_score skip BM25 entirely.GET /index/_explain/<id> // full BM25 breakdown for one doc
{ "query": { "match": { "title": "tuning" } } }
GET /index/_search?explain=true // per-hit explanation inline