An inverted index is a data structure used in information retrieval (IR) to efficiently store and retrieve documents based on the occurrence of terms. It maps terms (or words) to the list of documents that contain them, allowing the retrieval system to quickly identify and rank relevant documents for a given query.
In an inverted index, each term in the corpus is associated with a posting list, which includes the documents where the term appears and sometimes additional information like term frequency or document frequency. This index enables fast lookup of documents that match query terms.
The inverted index is a key component of many search engines, helping them to process queries quickly by only focusing on relevant documents that contain the queried terms, thus improving the efficiency of the retrieval process.