---
title: "What Is an Inverted Index? A Simple Search Example | Ceisium"
description: "Learn how an inverted index turns page text into postings lists, finds multi-word matches, supports ranking, and stays updated as content changes."
canonical: https://ceisium.com/blog/what-is-an-inverted-index/
---

> For the complete documentation and public content index, see [llms.txt](/llms.txt). This page is the Markdown alternative to the canonical HTML page.

![A term dictionary sends one highlighted term through posting lists to matching document nodes.](https://ceisium.com/blog/inverted-index-cover.webp)

A term dictionary sends one highlighted term through posting lists to matching document nodes.

![A term dictionary sends one highlighted term through posting lists to matching document nodes.](https://ceisium.com/blog/inverted-index-cover.webp)

A term dictionary sends one highlighted term through posting lists to matching document nodes.

1.  [Home](https://ceisium.com/)
2.  /
3.  [Blog](https://ceisium.com/blog/)
4.  /
5.  What Is an Inverted Index?

Published

July 15, 2026

Updated

July 15, 2026

# What Is an Inverted Index?

An inverted index maps terms to the documents that contain them, helping search engines find text matches without scanning every page.

 [![](https://ceisium.com/blog/share-icons/x.webp)](https://twitter.com/intent/tweet?text=What%20Is%20an%20Inverted%20Index%3F&url=https%3A%2F%2Fceisium.com%2Fblog%2Fwhat-is-an-inverted-index%2F)[![](https://ceisium.com/blog/share-icons/linkedin.webp) ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fceisium.com%2Fblog%2Fwhat-is-an-inverted-index%2F)[![](https://ceisium.com/blog/share-icons/hacker-news.webp)](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fceisium.com%2Fblog%2Fwhat-is-an-inverted-index%2F&t=What%20Is%20an%20Inverted%20Index%3F)

[Search](https://ceisium.com/blog/?tag=Search) [Learn](https://ceisium.com/blog/?tag=Learn)

A user searches a help site for:

TEXT

```
reset password
```

The site has four pages. In this example, the search system indexes both the page title and the text below it.

ID

Page title

Text

P1

Manage your account

Manage your account and password.

P2

Reset a forgotten password

Reset a forgotten password.

P3

Billing help

Download invoices and update payment details.

P4

Protect your account

Protect your account with two-factor authentication.

The system could open all four pages and check every word. That works here, but repeating the scan for every query becomes wasteful as the collection grows.

Instead, it prepares a lookup before the user searches. That lookup is an inverted index.

## What is an inverted index?

An inverted index maps each searchable term to the documents that contain it.

For our four pages, part of the index looks like this:

TEXT

```
account        -> P1, P4password       -> P1, P2reset          -> P2payment        -> P3authentication -> P4
```

This is similar to the index at the back of a book. You start with a topic and get the pages where it appears.

The mapping is called inverted because it reverses the direction we begin with. The original content starts as pages containing words. Search needs words pointing to pages .

The set of searchable terms is often called the **vocabulary** or **lexicon**. A term dictionary organizes those terms and points to their postings lists.

The list beside each term is a **postings list**. The postings list for `password` is `P1, P2`. Each document entry inside that list is one **posting**.

![Black llama-head blob turning four page cards into a vocabulary whose terms point to P1 and P2 postings.](https://ceisium.com/blog/what-is-an-inverted-index/pages-become-postings.webp)

The direction changes: pages contain terms, but the search lookup starts with a term and follows it to page IDs.

![Black llama-head blob turning four page cards into a vocabulary whose terms point to P1 and P2 postings.](https://ceisium.com/blog/what-is-an-inverted-index/pages-become-postings.webp)

The direction changes: pages contain terms, but the search lookup starts with a term and follows it to page IDs.

## How is an inverted index built?

The system first extracts the text it wants to make searchable. It then breaks that text into smaller units called tokens.

For example:

TEXT

```
"Reset a Forgotten Password"
```

may become:

TEXT

```
reset, a, forgotten, password
```

The system may also make text lowercase or handle punctuation. These choices make document terms and later query terms compatible. The exact processing varies by implementation.

Each final term is added to the postings for the field being indexed. Some systems keep separate term dictionaries and postings for fields such as titles and bodies.

## How does search use the index?

Now the user searches for:

TEXT

```
reset password
```

The search system analyzes the query into terms compatible with those stored in the index:

TEXT

```
[reset, password]
```

Then it reads the two postings lists:

TEXT

```
reset    -> P2password -> P1, P2
```

P2 appears in both lists, so it contains both query terms. P1 appears only in the `password` list, so it is a partial match. Whether P1 is retained depends on whether the search requires every term or allows partial matches.

The shared part of the lists is their **intersection**. For this query, the intersection is just P2.

The engine can start with these short term-led lists instead of reopening every page to discover possible matches. Those possible matches are the candidates that a ranking method can order.

![Black llama-head blob pulling reset and password posting strips through a clamp that keeps shared page P2 and leaves P1 as a partial match.](https://ceisium.com/blog/what-is-an-inverted-index/postings-intersection.webp)

P2 appears in both postings lists. It survives the intersection, while P1 is only a partial match.

![Black llama-head blob pulling reset and password posting strips through a clamp that keeps shared page P2 and leaves P1 as a partial match.](https://ceisium.com/blog/what-is-an-inverted-index/postings-intersection.webp)

P2 appears in both postings lists. It survives the intersection, while P1 is only a partial match.

## Does an inverted index rank the results?

The index retrieves candidates and can store clues about them. A posting may include how often the term appeared and where it appeared among the other tokens. The system may also keep separate postings for the title and body.

In our example, P2 contains both query terms, and both appear in its title. P1 contains only `password`. A ranking formula can use those differences to give P2 a stronger score.

Ranking turns those clues into an order. The index retrieves possible matches and stored clues. The ranker decides their order.

Methods such as [BM25 ![](https://ceisium.com/blog/bm25-cover-ceisium-bottom-right-aligned.webp)Search / Jun 24, 2026 What is BM25? A Plain English Guide BM25 is a keyword search ranking function that scores documents using term frequency, term rarity, and document length. Learn how it works, where it helps, and how it differs from TF-IDF.](https://ceisium.com/blog/what-is-bm25/)  rank word-based matches using term evidence. The inverted index makes that evidence available; the ranking method decides how much each clue matters.

Stored token positions can also support phrase or nearby-word search. P2 is not an exact-phrase match for `reset password` because another word sits between the two terms. A hypothetical page containing the exact phrase could be treated differently from one where the words appear paragraphs apart. Not every index stores positions, so this behavior depends on the system.

## What happens when a page changes?

Suppose P1’s title and text both change:

TEXT

```
Title: Manage your accountText:  Manage your account and password.
```

becomes:

TEXT

```
Title: Profile and login settingsText:  Update your profile and login settings.
```

Conceptually, selected affected postings change like this:

TEXT

```
account  -> remove P1password -> remove P1profile  -> add P1login    -> add P1settings -> add P1
```

This does not mean every engine edits one list in place. An implementation may write new index segments, mark old entries as deleted, merge segments later, or rebuild on a schedule. The useful reader model is simpler: P1 must stop appearing under its old terms and start appearing under its new ones.

A single edit does not always require rebuilding the complete index. Search can still lag behind the source content when updates are delayed or batched.

The targeted lookup has a cost. The index takes storage and work to build and maintain, and new content must reach it before search can use it.

The index is a maintained lookup over the source content, not the source content itself. The source page can change before its searchable representation is refreshed.

## What does an inverted index not solve?

A basic inverted index is strong at finding exact or normalized word-based terms. It does not automatically understand every way a person can describe the same need.

A user may search for:

TEXT

```
forgot my login
```

while the useful page says:

TEXT

```
Reset your password
```

Those phrases share little vocabulary. Synonym handling, spelling correction, query expansion, or [vector search ![](https://ceisium.com/blog/vector-search-cover.webp)Search / Jul 10, 2026 What Is Vector Search? Vector search finds related content by comparing embeddings. Learn how vectors, similarity, approximate nearest-neighbor search, and hybrid retrieval work together.](https://ceisium.com/blog/what-is-vector-search/)  can help with differently worded meaning. An inverted index does not add those choices automatically.

Word-based matching still matters for product names, API routes, error codes, and exact technical terms. A search system can combine more than one retrieval method when its query mix needs both literal and semantic evidence.

## Inverted index summary

An inverted index keeps a postings list for each searchable term.

The basic flow is:

TEXT

```
indexed fields -> searchable terms -> postings listsquery          -> compatible terms -> matching postings
```

It makes candidate lookup targeted. Optional stored clues can support ranking and phrase behavior, while update work keeps the lookup fresh.

Start with the term, then follow it to the documents.

 [![](https://ceisium.com/blog/share-icons/x.webp)](https://twitter.com/intent/tweet?text=What%20Is%20an%20Inverted%20Index%3F&url=https%3A%2F%2Fceisium.com%2Fblog%2Fwhat-is-an-inverted-index%2F)[![](https://ceisium.com/blog/share-icons/linkedin.webp) ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fceisium.com%2Fblog%2Fwhat-is-an-inverted-index%2F)[![](https://ceisium.com/blog/share-icons/hacker-news.webp)](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fceisium.com%2Fblog%2Fwhat-is-an-inverted-index%2F&t=What%20Is%20an%20Inverted%20Index%3F)

Copy image[](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fceisium.com%2Fblog%2Fwhat-is-an-inverted-index%2F)[](https://twitter.com/intent/tweet?text=%E2%80%9CWhat%20Is%20an%20Inverted%20Index%3F%E2%80%9D&url=https%3A%2F%2Fceisium.com%2Fblog%2Fwhat-is-an-inverted-index%2F)

**Yuvraj** _Building Ceisium and working on growth @ SigNoz_ ceisium.com

## Next reads

[

![BM25 scores query terms using rarity, repetition, and document length signals.](https://ceisium.com/blog/bm25-cover-ceisium-bottom-right-aligned.webp)

What is BM25? A Plain English Guide

BM25 is a keyword search ranking function that scores documents using term frequency, term rarity, and document length. Learn how it works, where it helps, and how it differs from TF-IDF.

](https://ceisium.com/blog/what-is-bm25/)[

![A query vector follows a highlighted path toward a nearby cluster of related content.](https://ceisium.com/blog/vector-search-cover.webp)

What Is Vector Search?

Vector search finds related content by comparing embeddings. Learn how vectors, similarity, approximate nearest-neighbor search, and hybrid retrieval work together.

](https://ceisium.com/blog/what-is-vector-search/)
