When someone searches a document collection, the engine needs to find matching documents without reading every document in full. An inverted index provides that lookup: for each field and term, it stores a postings list of documents containing the term. Postings can also record positions within documents. section 2.1.3 section 5.4.3
Indexing and searching work in opposite directions:
- At index time, process and normalize document tokens, then record each term under its field with references to document identifiers and positions. section 13.2.1 section 5.4.3
- At search time, process the query terms the same way, retrieve their postings lists, and combine matches. Boolean operations can select documents containing particular combinations of terms; positional matching can distinguish term sequences. section 13.2.1 section 2.1.3
- Rank the retrieved documents with a scoring method such as BM25. A fast match is not, by itself, proof that the result answers the user's intent. section 13.2.1
A small postings lookup
Suppose three job documents have skills fields: document 1 contains “Python” and “SQL”; document 2 contains “Python”; document 3 contains “SQL.” The skills postings lists are python → [1, 2] and sql → [1, 3]. Intersecting them finds document 1 for a query requiring both skills. Real postings can also retain positions, allowing more precise matching within a field. section 5.4.3 section 2.1.3
The reverse mapping—a forward index—lists the terms in each document field. Together, the two directions support traversal from a term to shared documents and onward to other terms. This can expose relationships in a semantic knowledge graph without explicitly modeling its nodes and edges. In Lucene-based search engines, doc values commonly provide the forward mapping for faceting. section 5.4.3 section 2.1.3
Figure 5.5 Three representations of an SKG. The data structure view shows terms mapped to sets of documents, the set-theory view shows how the intersection of sets of documents forms the relationship between them, and the graph view shows the nodes and edges.
Compare term-to-document postings, intersections of document sets, and the resulting graph relationships. section 5.4.3
An inverted index also serves as a sparse representation of documents: terms act as dimensions, and query expansion can supply additional weighted terms. Its limitation remains query-term dependence—matching strings and their normalized forms does not establish that a document is an objectively good semantic match. section 7.4.3 section 13.2.1




