Skip to content
BENIBIX Learn

Inverted Index

Also known as Inverted File Index, Posting List, Search Index (Keywords)

A list of each word and the pages that hold it. It makes word search fast.

Think of it like

It is like the index at the back of a book. Look up a word and get the pages it is on.

Example

Three pages mention "llama". The index line reads llama: page 2, page 7, page 9. A search for llama jumps straight there.

Why it matters

It makes keyword search fast at any size. BM25 and hybrid search sit on top of it.

Definition

An inverted index is a list of every word, each with the documents that hold it. A normal file goes from a document to its words. This goes the other way, from a word to its documents. To search, the engine looks up each word and joins the lists. That is why keyword search stays fast over millions of pages. Most search engines are built on one.
Each word points to the pages that hold it, so a search jumps straight there.

Common mistake

Thinking it understands meaning. It only knows which words appear where.

Key takeaways

  1. 1
    Word to pages. The reverse of a normal file.
  2. 2
    Join the lists. Many words, one fast answer.
  3. 3
    Exact words. No sense of meaning.