1. A computer-implemented method comprising: accessing an inverted index comprising a plurality of inverted index lists in a memory of a computer, each inverted index list corresponding to a term, each inverted index list comprising a term identifier of the term and one or more document identifiers indicating one or more documents of a document set in which the term appears; using a processor of the computer, generating a plurality of ordered pairs from the inverted index, each ordered pair comprising a term identifier and a document identifier of an inverted index list, the ordered pairs being organized primarily based on the document identifiers of the ordered pairs; and using the processor of the computer, generating a term identifier index according to the inverted index, the term identifier index comprising a plurality of sections, each section corresponding to a document, each section comprising one or more term identifiers of one or more terms that appear in the document, the generating the term identifier index according to the inverted index comprising organizing the term identifiers of the ordered pairs in the sections of the term identifier index, wherein organizing the term identifiers of the ordered pairs comprises: removing a selected ordered pair from a data structure; generating a next ordered pair from the inverted index, the next ordered pair comprising a term identifier equivalent to a term identifier of the selected ordered pair; and placing the next ordered pair into the data structure.