specialized database index to accelerate full-text search
In information science, an inverted index (also referred to as a postings list, postings file, or inverted file) is a database index storing a mapping from content, such as words or numbers, … Wikipedia
🌐
Wikipedia
en.wikipedia.org › wiki › Inverted_index
Inverted index - Wikipedia
May 17, 2026 - In information science, an inverted index (also referred to as a postings list, postings file, or inverted file) is a database index storing a mapping from content, such as words or numbers, to its locations in a table, or in a document or a set of documents (named in contrast to a forward ...
🌐
GeeksforGeeks
geeksforgeeks.org › dbms › inverted-index
Inverted Index - GeeksforGeeks
April 18, 2026 - An inverted index is an index data structure storing a mapping from content, such as words or numbers, to its locations in a document or a set of documents. In simple words, it is a hashmap-like data structure that directs you from a word to ...
🌐
Cockroach Labs
cockroachlabs.com › home › resources › blog › what is an inverted index, and why should you care?
What is an inverted index, and why should you care?
August 17, 2023 - As you can see, this index lists the location of each word (called a token) in the table. Inverted indexes are used to facilitate more efficient full-text searches in a database.
🌐
Inverted
docs.inverted.ai › en › latest › pythonapi › sdk-drive.html
DRIVE - invertedai-drive 0.1.4 documentation
invertedai.api.drive(location: ... = None, api_model_version: Optional[str] = None) → DriveResponse[source]# Update the state of all given agents forward one time step. Agents are identified by their list index....
🌐
LIS Academy
lis.academy › information-processing-retrieval › how-indexing-information-representation-retrieval
How Indexing and Information Representation Drive Information Retrieval - LIS (Library & Information Science) Academy
November 9, 2025 - It’s called “inverted” because instead of organizing information by document and then listing the terms each contains (as in a forward index), it organizes information by term and then lists the documents containing each term.
🌐
Stanford NLP Group
nlp.stanford.edu › IR-book › html › htmledition › a-first-take-at-building-an-inverted-index-1.html
A first take at building an inverted index
Index the documents that each term occurs in by creating an inverted index, consisting of a dictionary and postings. We will define and discuss the earlier stages of processing, that is, steps 1-3, in Section 2.2 (page ). Until then you can think of tokens and normalized tokens as also loosely ...
Find elsewhere
🌐
Baeldung
baeldung.com › home › data structures › indexing: inverted index
Indexing: Inverted Index | Baeldung on Computer Science
March 18, 2024 - An inverted index works by mapping each unique word or term in a set of documents to the documents in which it occurs. This is in contrast to a forward index, which maps each document to the words it contains.
🌐
Medium
satyadeepmaheshwari.medium.com › inverted-index-the-backbone-of-modern-search-engines-8bfd19a9ff75
Inverted Index: The Backbone of Modern Search Engines | by Satya Deep Maheshwari | Medium
April 19, 2025 - These keep your memory and storage from becoming a digital hoarder’s garage. In an inverted index, a term is a normalized unit of text (a keyword), and a field is the part of the document where the term occurs (like title, body, tags).
🌐
Reddit
reddit.com › r/sql › eli5: inverted index
r/SQL on Reddit: ELI5: Inverted Index
April 9, 2024 -

I read the Wikipedia and am having a hard time getting this concept to click. Of course I could ask chatGPT but this community is more fun!

Can I get this concept simplified with a couple real world examples?

Top answer
1 of 3
17
A normal index is a way to look up content by key. An inverted index is a way to look up key by content. Consider the case of an older-approach n-gram search engine, like Google from 15 years ago. Generally what you do is build an index, then a reverse index, then you use the reverse index to find things. Building the forward index is relatively simple. You break the document down into terms, throw away numbers and symbols, then you number the terms globally. So, "the quick brown fox" is something like [t10, t40, t25, t21], and "the mighty blue fox" is something like [t10, t28, t613, t21]. The first document is d1, the second document is d2, and so on. Next, you build the 1-gram reverse index, which says something like "the word t10: the can be found in documents d1, d2, d7, ... and so on. The 2-gram database is going to be tokens for two terms at once, so you get things like t3971: the quick, t3972: quick brown, t3973: brown fox, and so on (for quoted queries;) then they just go into the same reverse index. So someone searches for the "quick brown" fox. You handle quotes then split on spaces to get tokens (yay parsers,) then go to the forward index to turn those tokens into a series of keys: [t10, t3972, t21], then you go to the reverse index to figure out what documents actually contain any of those three keys (in this case, just d1.) Then you ship the document list to the user. That way you can do simple integer comparisons instead of expensive and complex string comparisons. Forward index: "this key means this token." Reverse index (generally:) "this key is found here, here, and here."
2 of 3
1
It’s used for instance if your system needs to find documents fast. Instead of reading every document every time, the inverted index stores which words are available in what documents. Oracle databases have a dedicated document search functionality for this. It uses an inverted index that can be seeded ahead of time, and can be augmented with every added document. That way, a search needs to consult the index, only, which is way faster than reading every document every time. Bonus points for using a sound-alike fuzzy search to accommodate misspellings.
🌐
Medium
medium.com › @igorkopanev › a-brief-explanation-of-the-inverted-index-f082993f8605
A brief explanation of the Inverted Index | by Ihor Kopanev | Medium
November 19, 2019 - The inverted index is a database index storing a mapping from content, such as words or numbers, to its locations in a database, or in a document or a set of documents.
🌐
Milvus
milvus.io › home › ai reference › how does an inverted index work?
How does an inverted index work?
This structure is fundamental to search engines and databases, enabling fast lookups for queries like “find all documents containing the word 'apple.’” At its core, an inverted index consists of two main components: a dictionary of unique terms and postings lists that link each term to the documents (and often positions within those documents) where it occurs.
🌐
PingCAP
pingcap.com › home › articles › inverted index vs other indexes: key differences
Inverted Index vs Other Indexes: Key Differences
December 12, 2024 - This optimization is vital for applications requiring real-time data access and high-speed transactions, such as online transaction processing (OLTP) systems. An inverted index is a data structure used primarily in text search engines.
🌐
Velodb
velodb.io › glossary › inverted-index-1
What Is Inverted Index? Full-Text Search in Databases for AI & Log Analytics
January 23, 2026 - In practice, inverted indexes perform best when queries are keyword-driven and data is append-heavy—such as log analytics, document search, or RAG retrieval where users look for specific terms, error codes, or phrases. However, they are less effective for leading wildcard queries (e.g., LIKE '�c%'), frequent in-place updates, or scenarios where semantic similarity outweighs exact keyword matching.
Top answer
1 of 6
265

One common use is "...to allow fast full-text searching."

The two types denote directionality. One takes you forward through the index, and the other takes you backward (the inverse) through the index. That's it. There's no mystery to uncover here. Otherwise the two types are identical, it's just a question of what information you have, and as a result what information you're trying to find.

To address your inquiry, I don't think there's actually a way to know why the use is what it is today. The only reason it's important to define which is forward and which one is inverted is so that we can all have a conversation about them, and everyone knows which direction we're talking about. Think about the terms "left" and "right": they are relative. Which is which doesn't matter, except that everyone needs to agree which one is "left" and which one is "right" in order for the words to have meaning. If, as a culture, we decided to flip left and right, then you'd have the same issue figuring out what a "right turn" vs a "left turn" is since the agreed upon meaning had changed. However, the naming is arbitrary, so which one is which (in and of itself) doesn't matter - what matters is that we all agree on the meaning.

In your comment where you ask, "please don't just define the terms", you're missing the point, and I think you're just getting hung up on the wording when there is absolutely no difference between them.


For the benefit of future readers, I will now provide several "forward" and "inverted" index examples:

Example 1: Web search

If you're thinking that the inverse of an index is something like the inverse of a function in mathematics, where the inverse is a special thing that has a different form, then you're mistaken: that's not the case here.

In a search engine you have a list of documents (pages on web sites), where you enter some keywords and get results back.

A forward index (or just index) is the list of documents, and which words appear in them. In the web search example, Google crawls the web, building the list of documents, figuring out which words appear in each page.

The inverted index is the list of words, and the documents in which they appear. In the web search example, you provide the list of words (your search query), and Google produces the documents (search result links).

They are both indexes - it's just a question of which direction you're going. Forward is from documents->to->words, inverted is from words->to->documents.

Example 2: DNS

Another example is a DNS lookup (which takes a host name, and returns an IP address) and a reverse lookup (which takes an IP address, and gives you the host name).

Example 3: A book

The index in the back of a book is actually an inverted index, as defined by the examples above - a list of words, and where to find them in the book. In a book, the table of contents is like a forward index: it's a list of documents (chapters) which the book contains, except instead of listing the words in those sections, the table of contents just gives a name/general description of what's contained in those documents (chapters).

Example 4: Your cell phone

The forward index in your cell phone is your list of contacts, and which phone numbers (cell, home, work) are associated with those contacts. The inverted index is what allows you to manually enter a phone number, and when you hit "dial" you see the person's name, rather than the number, because your phone has taken the phone number and found you the contact associated with it.

2 of 6
41

They called it inverted just because there is already a forward index. Take the example of search engine, it composed by two parts: the first part is "web crawler and parser" which build a index from document to word, the second part is search database which build a index from word to document. Because of the first index exist, we naturally call the second index as inverted index.

If you name the TOC (Table of Content) of a book as index, then you should call the index at the end of book as "inverted index". Or, in other side, you can call the TOC as inverted index.

🌐
Apache
doris.apache.org › blog › inverted-index-accelerates-text-searches-by-40-time-apache-doris
A deep dive into inverted index: how it speeds up text searches by 40 times - Apache Doris
February 1, 2024 - When executing queries of specific words, the system locates the row numbers in this orderly mapping using the skip list index and binary search methods. Based on the row numbers, the system retrieves the entire data record. This approach avoids line-by-line matching and reduces computational complexity from O(n) to O(logn). That's how inverted index speeds up queries on large datasets.
Top answer
1 of 3
16

Here is an array:

  • A[0] = Alice
  • A[1] = Bob
  • A[2] = Charlie

Here 0,1,2 are indices.

Now suppose that we want to know which index contains a given word. Then we use a dictionary:

  • D[Alice] = 0
  • D[Bob] = 1
  • D[Charlie] = 2

This is an inverted index (according to your Wikipedia quote).


The word index has different meaning in different contexts:

  • Technical books often have an index of terms at the end.
  • The Catholic church held an index of forbidden books.
  • In economics, there are financial indices.
  • In computer science, an index is usually an integer used to index into an array.
2 of 3
9

The reason why we use the term "inverted index" is that the term "index" came to computer science first. In fact, it has several common meanings in computer science, but in this case it refers to the more general concept of an efficient lookup data structure for a database.

What we call an "inverted index" is, strictly speaking, an inverted file used as a database index. "Inverted file" is the data structure, and "index" is the use to which it is put. A B-tree data structure, similarly, can be put to more uses than just database indexing, but it makes sense to talk of a "B-tree index".

The index in a book is not the only kind of text index. Strong's Concordance, which is considered an important ancestor of modern full-text search, is a permuted index (specifically, a variant known today as a KWIC index).

The inverted file is not the only data structure that can be used for text/string indexing. Suffix arrays and Burrows-Wheeler indexes are commonly used for strings that don't need linguistic analysis such as indexing DNA or RNA sequences. Some of these index variants have efficient partial match queries.

The signature file (a probabilistic index structure, essentially Bloom filters for text search) was briefly popular, but it turned out to be nowhere near as generally useful as its competitors.

🌐
Deepaksood619
deepaksood619.github.io › databases › comprehensive guide to indexing › understanding inverted indexes
Inverted Index | Deep Notes
October 23, 2025 - The purpose of an inverted index is to allow fast full text searches, at a cost of increased processing when a document is added to the database. The inverted file may be the database file itself, rather than its index.
🌐
DataSunrise
datasunrise.com › home › elasticsearch inverted index: the key to fast data retrieval
Elasticsearch Inverted Index | Knowledge Center
July 18, 2025 - Elasticsearch is a popular choice for organizations looking to search and analyze large amounts of data. The secret behind Elasticsearch’s speed lies in the inverted index—a structure optimized for rapid text search and retrieval.
🌐
Wikiwand
wikiwand.com › en › Inverted_index
Inverted index - Wikiwand
In computer science, an inverted index is a database index storing a mapping from content, such as words or numbers, to its locations in a table, or in a document or a set of documents.