โ† Elasticsearch learning path
Elasticsearch ยท Module 5 of 10

Relevance and scoring

Elasticsearch scores documents with BM25 and lets you tune it.

๐Ÿ“– Key ideas

  1. BM25 rewards terms that appear often in a document but rarely across the index.
  2. Matches in short fields count more than in long ones.
  3. Boosting (title^3) gives some fields more weight.
  4. function_score can add popularity or recency.
  5. The explain API shows how a score was calculated.
๐Ÿ’ก Real-life example: Like judging a quiz answer: a rare correct keyword earns more marks than a common word everyone wrote.
BM25Default relevance formula
BoostExtra weight for a field or clause
IDFRarer terms count more
explainAPI that shows score details