Class AlignDocumentIterator

  • All Implemented Interfaces:
    DocumentIterator

    public class AlignDocumentIterator
    extends AbstractIntervalDocumentIterator
    A document iterator that aligns the results of two iterators over different indices.

    This class is an example of cross-index computation. As in the case of an AndDocumentIterator, we intersect the posting lists. However, once we get to the index level, we actually return just intervals that appear in all component iterators. Of course, this is meaningful only if all indices represent different views on the same data, a typical example being semantic tagging.

    An instance of this class exposes a single interval iterator associated with the index of the first component iterator, as all interval iterators are exhausted during the computation of their intersection. Correspondingly, a call to IntervalIterator.intervalTerms(LongSet) just returns the terms related to the first component iterator.