Skip to content
Ask Sera Search
Ask SeraAnswers from our guides, research and news Search
Learn
Guides
Research
Sectors
Platforms
News
Tools
About

What is an inverted index?

An inverted index lists, for each word, the documents that contain it. Keyword search engines use it to find matching documents without scanning every text.

In short. An inverted index is the data structure of keyword search: for each word, it lists the documents that contain it. A search engine builds it before any query arrives. At query time, the engine looks up each query word and reads its list of documents, instead of scanning every text. Azure AI Search keeps one inverted index for each searchable field.

On this page 6 sections

The evidence

  • Confirmed:

    Introduction to Information Retrieval calls the inverted index the first major concept in information retrieval. It says the structure is essentially without rivals as the most efficient way to support ad hoc text search.1Introduction to Information Retrieval, Cambridge University Press

    Cambridge University Press textbook, online edition. Checked Dec 1, 2026.

  • Confirmed:

    Azure AI Search stores one inverted index for each searchable field. Each index holds a sorted list of all terms, and each term maps to the documents in which it occurs.3Microsoft Learn. Checked Dec 1, 2026

  • Confirmed:

    The dictionary of an inverted index records the document frequency of each term, the number of documents that contain it. Many ranked retrieval models use this statistic.2Introduction to Information Retrieval, Cambridge University Press

    Cambridge University Press textbook, online edition. Checked Dec 1, 2026.

Confirmed by the platform

An inverted index lets a search engine find every document that contains a word without reading the documents at query time. It is the index behind keyword search and the keyword side of AI retrieval.

#How does an inverted index work?

An inverted index has two parts: a dictionary of terms and, for each term, a list of the documents that contain it. Introduction to Information Retrieval, a Cambridge University Press textbook, calls each entry in a list a posting and each list a postings list. The dictionary is sorted alphabetically, and each postings list is sorted by document ID.1

Microsoft's page on full text search in Azure AI Search gives an example. Four hotel documents have the titles "Hotel Atman", "Beach Resort", "Playa Hotel" and "Ocean Retreat". Part of the inverted index for the title field looks like this:3

Text
atman    -> 1
beach    -> 2
hotel    -> 1, 3
ocean    -> 4
playa    -> 3

A query for "hotel" reads one line and gets documents 1 and 3. A phrase query such as "ocean view" looks up both terms and then checks how close together they appear in the document.3

#How is an inverted index built?

The engine builds the index before it answers queries. The textbook's section on building an inverted index lists four steps: collect the documents, split each text into tokens, normalize the tokens into indexing terms, and record the documents that each term occurs in.2 The core step sorts the pairs of term and document ID, merges duplicates, and splits the result into the dictionary and the postings.

The normalizing step decides what can match. Azure AI Search runs each text through an analyzer that lowercases it and strips punctuation, and it usually runs the same analyzer on queries.3 The Elastic documentation on text analysis shows the limits. Without more analysis, "Quick" does not match "quick", "foxes" does not match "fox", and "jumps" does not match its synonym "leaps".4

The inverted index is the part of a retrieval system that finds exact words. Ranking functions such as BM25 score the documents it returns, using statistics such as the document frequency stored in the dictionary.2

Many AI retrieval systems pair it with a vector index in hybrid search. Microsoft's hybrid search overview says vector search can find similar content even when there are no keyword matches in the inverted index. Keyword search does better on exact matches such as product codes and people's names.5

A page enters an inverted index through the words it contains. A product name or a model number written in the text can match a query for it exactly. What is semantic search? explains how keyword search and search by meaning differ, and How Google crawls and indexes pages covers how pages get into Google's index.

Read next

Related terms

Questions

Why is it called an inverted index?

A document lists its words, and the index turns this around to list the documents for each word. Introduction to Information Retrieval says the name is redundant, because every index maps terms back to where they occur, but inverted index has become the standard term.

Is an inverted index the same as a vector index?

No. An inverted index maps words to documents and supports keyword search. A vector index stores embeddings and supports search by meaning. Hybrid search uses both.

Does an inverted index match synonyms?

Only with extra text analysis. Elasticsearch says a search for 'jumps' does not match 'leaps', and a search for 'foxes' does not match 'fox', unless text analysis adds stemming or synonyms.

About this page

Researched and reviewed by Promptly Found. Reviewed Dec 1, 2026. Next review due Mar 2027.

Notes

  1. 1
    An example information retrieval problemIntroduction to Information Retrieval, Cambridge University Press · Checked Dec 1, 2026 · Secondary source
  2. 2
    A first take at building an inverted indexIntroduction to Information Retrieval, Cambridge University Press · Checked Dec 1, 2026 · Secondary source
  3. 3
    Full text search in Azure AI SearchMicrosoft Learn · Checked Dec 1, 2026 · Primary source
  4. 4
    Text analysisElastic documentation · Checked Dec 1, 2026 · Primary source
  5. 5
    Hybrid search using vectors and full-text search in Azure AI SearchMicrosoft Learn · Checked Dec 1, 2026 · Primary source
Cite this page
Citation style

Promptly Found. (2026, December 1). What is an inverted index? https://promptlyfound.com/glossary/inverted-index

Revisions 1
First published.