---
title: "Inverted index and posting lists"
description: "Map each term to the documents that contain it, combine posting lists to answer a query, keep counts and positions for phrases, then build and store it."
canonical_url: "https://fanout.sh/system/archive/inverted-index-and-posting-lists"
md_url: "https://fanout.sh/system/archive/inverted-index-and-posting-lists.md"
last_updated: "2026-11-07"
access: "pro-preview"
---

# Inverted index and posting lists

Map each term to the documents that contain it, combine posting lists to answer a query, keep counts and positions for phrases, then build and store it.

- Access: Fanout Pro (public preview)

## The core idea

The previous query found possible documents without re-reading every sentence.

That shortcut needs something prepared in advance: for each searchable word, retain the identifiers of documents that contain it.

## In this lesson

- From documents to terms
- Combining the lists
- Counts and word order
- Building and storing the index
- Inspect the existing Code implementation

## Continue reading

Pro unlocks video lessons, visual walkthroughs, full notes, diagrams, case studies, and implementations across the System Design archive.

---
This representation contains public Fanout content only. Protected Pro lessons, account data, billing, checkout, and pricing are not included.

Browse the public content map: https://fanout.sh/sitemap.md
