This technique work for any boolean query language and is
easily extended to any query language built from primitive queries and
some means of combination.
Performance is dominated by Q log D where Q is the
number of distinct primitive queries and D is the number of
words in the document; Q >> D.