Indexing and query processing
Problems
- Phrase query
Find the documents in which the query terms occur next to each other in the given order.
intro - Posting list intersection
Given the sorted posting lists of the terms of an AND query, output the documents that appear in all of them.
intro - Ranked retrieval
Given a query and a scoring function, return the k documents of highest score, ideally without scoring every document.
intro - Dynamic index maintenance
Keep an inverted index current while documents are added and deleted, with fast queries and low merge cost.
core - Wildcard query
Find the documents that contain any term matching a pattern with wildcards, such as mon*h.
core - Document identifier reassignment
Renumber the documents of a collection so that the gaps in the posting lists are small and the index compresses best.
advanced
Algorithms
- Merge-based list intersection
Walks two sorted posting lists with one pointer each and advances the smaller, in time linear in the sum of the lengths.
1 languagesintro - Blocked sort-based indexing
Builds an inverted index on disk by sorting blocks of termid-docid pairs in memory and merging the sorted runs.
1 languagescore - Document-at-a-time evaluation
Reads all query posting lists in parallel in docid order and scores each document fully before moving on, keeping a heap of the best k.
1 languagescore - Logarithmic merging
Keeps indexes of sizes n, 2n, 4n and so on, and merges two of equal size like a binary counter, so each posting is merged O(log(T/n)) times.
1 languagescore - Porter stemmer
Removes English suffixes in five rule phases, each rule guarded by a condition on the measure of the remaining stem.
1 languagescore - Positional intersection
Intersects two positional posting lists and, inside each common document, merges the position lists to find occurrences within distance k.
1 languagescore - Single-pass in-memory indexing
Builds a separate dictionary and posting lists for each block in one pass with no global term ids, then merges the blocks.
1 languagescore - Term-at-a-time evaluation
Reads the posting lists one term after another and adds each term's contribution into a score accumulator per document.
1 languagescore - Baeza-Yates intersection
Searches the median of the shorter list in the longer one and recurses on both halves, adapting to the ratio of the list lengths.
1 languagesadvanced - Geometric partitioning
Keeps index partitions whose sizes grow geometrically by a ratio r, or at most p of them, trading merge cost against the number of partitions a query reads.
1 languagesadvanced - MaxScore
Splits query terms into essential and nonessential by their score upper bounds, and skips documents that only nonessential terms could lift into the top k.
1 languagesadvanced - Simple-9 coding
Packs as many small integers as fit into each 32-bit word, using 4 selector bits to choose one of nine equal-width layouts.
1 languagesadvanced - Small-versus-small intersection
Intersects many lists by taking the two shortest first and searching each candidate of the short list in the next one by galloping.
1 languagesadvanced - WAND
Sorts posting cursors by docid and finds a pivot where the summed term upper bounds first exceed the heap threshold, skipping all earlier documents.
1 languagesadvanced - Block-max WAND
Refines WAND with score upper bounds stored per block of postings, so whole blocks are skipped when their local bounds cannot reach the threshold.
1 languagesresearch - Demaine-Lopez-Ortiz-Munro adaptive intersection
Intersects k sorted sets by cycling through them with galloping search, in time bounded by the size of a proof of the result.
1 languagesresearch - Recursive graph bisection for index reordering
Orders documents by recursive balanced bisection of the term-document graph, moving documents to minimize a log-gap cost.
1 languagesresearch
Data structures
- Posting list
The sorted list of document ids, with optional frequencies and positions, for one term of an inverted index.
1 languagesintro - Permuterm index
Indexes every rotation of each term with an end marker, so a wildcard query becomes a prefix lookup in a search tree.
1 languagescore - Positional index
An inverted index whose postings store, for each document, the positions where the term occurs, so phrase and proximity queries can be answered.
1 languagescore - Tiered index
Splits each posting list into tiers by score, and reads lower tiers only when the higher tiers give fewer than k results.
1 languagescore - k-gram index
Maps each character k-gram to the dictionary terms that contain it, for wildcard queries and spelling correction.
1 languagescore - Impact-ordered index
Sorts each posting list by precomputed impact scores, so query evaluation reads the highest impacts first and can stop early.
1 languagesadvanced - Signature file
Stores for each document a bit signature made by OR-ing hashed term codes, so a scan rejects most documents without false negatives.
1 languagesadvanced - Partitioned Elias-Fano index
Splits each posting list into chunks chosen by dynamic programming and codes each chunk with Elias-Fano or a bitmap, to fit local density.
1 languagesresearch
Techniques
- Stemming
Maps the inflected and derived forms of a word to one stem before indexing and querying, so that a query word also matches its variants.
intro - Stop word removal
Drops the most frequent function words from the index or the query, to save space and time at a small cost in recall.
intro - Front coding
Stores each term of a sorted dictionary as the length of the prefix it shares with the previous term plus its remaining suffix.
1 languagescore - Postings gap encoding
Stores the differences between consecutive document ids of a posting list, which are small and compress well with integer codes.
core - Skip pointers
Adds about sqrt(n) forward pointers to a posting list so an intersection can jump over runs that cannot match.
core - Static index pruning
Removes low-impact postings from an inverted index at build time, so the index is smaller and faster with a small, measured loss in ranking quality.
advanced
Concepts
- Index partitioning
Distributes an index over machines either by documents, each node holding a full local index, or by terms, each node holding whole posting lists.
core
Definitions
- Term-document incidence matrix
A 0-1 matrix with a row for each term and a column for each document, set where the term occurs in the document.
intro
Models
- Heaps' law
The number of distinct terms in a collection of T tokens grows as k T^b with b near one half.
intro - Zipf's law
The frequency of the i-th most common term in a collection is roughly proportional to 1/i.
intro