8. An apparatus comprising: a memory operable to: store an inverted index comprising a plurality of inverted index lists, 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; and a processor operable to execute logic to: 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 generate 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.
8. An apparatus comprising: a memory operable to: store an inverted index comprising a plurality of inverted index lists, 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; and a processor operable to execute logic to: 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 generate 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. 13. The apparatus of claim 8 , the processor further operable to: generate an ontology affinity matrix comprising a plurality of entries, each entry corresponding to an affinity of a term pair comprising a first term and a second term, each entry comprising a count value indicating a number of times the term pair appears together in a document of the document set; and divide each count value of the ontology affinity matrix by one of a group consisting of a number of documents the first term appears in, a number of documents the second term appears in, and the number of documents the first term appears in plus the number of documents the second term appears in.