Patent ID: 7853598

Claim:
A method comprising: mapping, for a collection of documents, each term and each document to an integer value to obtain term identifiers (IDs) and document identifiers (IDs), respectively, the mapping of the term IDs and the document IDs performed based on a frequency each term occurs in the collection of documents; storing, in a main memory of a computing system, an indication of an occurrence of each term ID in the collection of documents in a document-grained inverted index for terms occurring in multiple documents of the collection of documents, and for each document-grained inverted index exceeding a threshold length storing the indication of the occurrence of each term ID in the collection of documents in a two-level data structure; storing, in the main memory of the computing system, positional information for each term ID in a separate data structure other than the document-grained inverted index, the positional information for each term ID stored based on a frequency each term occurs in the collection of documents and the number of different documents corresponding to those occurrences; determining a list of all the term IDs of each document; storing the list of all the term IDs, in the main memory of the computing system, without duplicates and without preserving an original order of the terms; and reconstructing a document from the collection of documents based on the list of all the term IDs of each document and the mapped term IDs and document IDs stored in the main memory of the computer system.