Inverse document frequency (IDF) measures whether a search term is common or rare across an indexed collection. In term frequency–inverse document frequency (TF-IDF), a term that appears often in one document but rarely across the collection receives more relevance weight. section 3.4.2
IDF contributes to relevance alongside other signals:
- Term frequency (TF) measures occurrences within a document; higher frequency can increase relevance. section 3.4.2
- Document frequency reflects collection-wide occurrence; higher document frequency lowers relevance under TF-IDF. section 3.4.2
- BM25 improves on TF-IDF by limiting repeated-term effects and normalizing for document length. section 3.4.2
Inspect IDF in a movie search score
Run a match query with "explain": true to expose scoring details. For a search such as title: "Lord", the explanation identifies how many documents contain the term (n), the total document count (N), and the IDF contribution to the score. section 8.8.3
Use the explain-enabled search request to inspect the engine’s score calculation instead of treating relevance as a black box. section 8.8.3
IDF is one component of Elasticsearch relevance scoring. Similarity algorithms apply scoring per field, and BM25 is the default algorithm; alternative or customized similarity choices are available when default ranking does not fit the requirement. section 3.4.2 section 3.4.1



