Reference · Cheat sheet

The inverted index

The compressed essence. Print it, pin it.

From lesson 0004See also glossary

Structure

Term (sorted)Postingsdoc freq (n)
brown[1, 2]2
fox[1]1
the[1, 2]2

Why it's fast

Feeds BM25 (lesson 0002)

BM25 inputComes from
n (for IDF)length of the term's postings list = document frequency
f(t,D) (TF)term frequency stored in the postings, at index time
field-length normfield length computed & stored at index time

The whole path

text → analyse → terms → seek term dictionary → merge postings → candidate docs → BM25 → ranked hits

Inspect it

GET /index/_termvectors/<id>      // term_freq + doc_freq per term
{ "fields": ["title"], "term_statistics": true, "field_statistics": true }

← lesson 0004 · Source: Definitive Guide — Inverted index