Class OrDocumentIterator

    • Constructor Detail

      • OrDocumentIterator

        protected OrDocumentIterator​(DocumentIterator... documentIterator)
    • Method Detail

      • getInstance

        public static DocumentIterator getInstance​(Index index,
                                                   DocumentIterator... documentIterator)
        Returns a document iterator that computes the OR of the given array of iterators.

        Note that the special case of the empty and of the singleton arrays are handled efficiently.

        Parameters:
        index - the default index; relevant only if documentIterator has zero length.
        documentIterator - the iterators to be joined.
        Returns:
        a document iterator that computes the OR of documentIterator.
      • getInstance

        public static DocumentIterator getInstance​(DocumentIterator... documentIterator)
        Returns a document iterator that computes the OR of the given nonzero-length array of iterators.

        Note that the special case of the singleton array is handled efficiently.

        Parameters:
        documentIterator - the iterators to be joined.
        Returns:
        a document iterator that computes the OR of documentIterator.
      • intervalIterator

        public IntervalIterator intervalIterator​(Index index)
                                          throws IOException
        Description copied from interface: DocumentIterator
        Returns the interval iterator of this document iterator for the given index.

        After a call to DocumentIterator.nextDocument(), this iterator can be used to retrieve the intervals in the current document (the one returned by DocumentIterator.nextDocument()) for the index index.

        Note that if all indices have positions, it is guaranteed that at least one index will return an interval. However, for disjunctive queries it cannot be guaranteed that all indices will return an interval.

        Indices without positions always return IntervalIterators.TRUE. Thus, in presence of indices without positions it is possible that no intervals at all are available.

        Specified by:
        intervalIterator in interface DocumentIterator
        Parameters:
        index - an index (must be one over which the query was built).
        Returns:
        an interval iterator over the current document in index.
        Throws:
        IOException
      • dispose

        public void dispose()
                     throws IOException
        Description copied from interface: DocumentIterator
        Disposes this document iterator, releasing all resources.

        This method should propagate down to the underlying index iterators, where it should release resources such as open files and network connections. If you're doing your own resource tracking and pooling, then you do not need to call this method.

        Specified by:
        dispose in interface DocumentIterator
        Overrides:
        dispose in class AbstractCompositeDocumentIterator
        Throws:
        IOException