Source: Elasticsearch docs: Similarity settings

Elasticsearch reference for per-field similarity: BM25 is the default (k1 1.2, b 0.75), with DFR, DFI, IB, LM and scripted alternatives.

Contents

Summary

Explains how to configure the scoring model per field in an index mapping, or as an index-wide default.

Key claims

  • The default similarity is BM25 with k1 = 1.2, b = 0.75 and discount_overlaps = true.
  • Alternatives: DFR, DFI, IB, LMDirichlet (mu default 2000), LMJelinekMercer (lambda default 0.1), and scripted.
  • Changing the index-wide default on an existing index requires closing it, updating settings and reopening it.
  • Scripted similarities must return positive scores that do not decrease with term frequency and do not increase with document length, or top hits can be wrong.
  • Similarity applies to text and keyword fields only.

Feeds

BM25

Suggest changes →