A query is separated into subqueries including a first subquery containing
terms applicable to a first data store and a second subquery containing
terms applicable to a second data store, where both data stores maintain
information regarding the documents. Applying the first subquery to the
first data store retrieves a first list of document identifiers
associated with documents that satisfy the terms of the first subquery.
The first list is combined with the second subquery to form a masked
subquery, which is applied to the second data store. The masked subquery
only seeks to identify document identifiers that both are included the
first list and that satisfy terms of the second query. The document
identifiers included in the first list may be ordered to match an order
in which the document identifiers are ordered in the second data store.