All Products
Search
Document Center

OpenSearch:Inverted index overview

Last Updated:Oct 19, 2026

What is an inverted index

An inverted index, also known as a reverse index, postings file, or inverted file, is an indexing method used in full-text search to store a mapping from a term to its locations in a document or a set of documents. It is the most commonly used data structure in document retrieval systems. An inverted index allows you to quickly locate the list of documents that contain a term, as well as information such as the positions of the term in each document and its term frequency. This information is used for information analysis.

Information stored in an inverted index

Information name

Description

ttf

Full name: total term frequency. The total number of times that the search term appears across all documents.

df

Full name: document frequency. The total number of documents that contain the search term.

tf

Full name: term frequency. The number of times that the search term appears in a document.

docid

Full name: document id. The unique identifier of a document in the engine. You can use the docid to obtain other information about the original document.

fieldmap

Full name: field map. Records information about the fields that contain the search term.

Section information

You can divide certain documents into sections and add supplementary information to each section. This information can be retrieved during retrieval for subsequent processing.

position

Records the positions of the search term in a document.

positionpayload

Full name: position payload. You can set payload information for different positions in a document. This information can be retrieved during retrieval for subsequent processing.

docpayload

Full name: document payload. You can add supplementary information to certain documents. This information can be retrieved during retrieval for subsequent processing.

termpayload

Full name: term payload. You can add supplementary information to certain terms. This information can be retrieved during retrieval for subsequent processing.

Basic structure of an inverted index

Structure name

Description

dictionary

Dictionary. Stores the mapping between search terms and posting lists. The engine uses the dictionary to find the location of the inverted index information for a search term.

doclist

Full name: document list. Stores information about the documents that contain the search term.

positionlist

Full name: position list. Stores the positions of the search term in each document.

truncatelist

Full name: truncate list. Used to improve engine performance. Based on your configuration, a separate inverted index is built for certain high-quality documents to improve retrieval performance.

bitmap

Used to improve engine performance. Based on your configuration, certain inverted index structures are stored as bitmaps to reduce the space occupied by the inverted index and improve retrieval performance.

Basic retrieval process of an inverted index

When a user queries the inverted index for term M, the engine first queries the dictionary file to find the starting position of the index term in the inverted index file (posting file). The engine then parses the posting list to obtain the three parts of information stored for term M in the posting list: TermMeta, DocList, and PositionList. TermMeta stores the basic description of the index term, mainly including the df, ttf, and termpayload information of the term. DocList is the list of document information for the index term. The document information includes the DocumentId, the frequency of the search term in the document (tf), the docpayload, and information about the fields that contain the search term (termfield). PositionList is the list of positions of the search term in the document, mainly including the specific positions of the search term in the document (position) and the positionpayload information.