One embodiment of the present invention provides a system that facilitates
accessing a compressed representation of a set of documents, wherein the
compressed representation supports searching and partial decompression.
During operation, the system receives a search request containing terms
to be searched for in the set of documents. In response to the search
request, the system identifies occurrences of the terms in the set of
documents by following pointers through the compressed representation.
This compressed representation encodes occurrences of a term as a pointer
to the next occurrence of the term to facilitate rapid enumeration of the
occurrences of the term. Moreover, the compressed representation
maintains sequential ordering between adjacent terms in the set of
documents, which allows fast access to neighboring terms.