Interface IndexReader

    • Method Detail

      • documents

        IndexIterator documents​(long termNumber)
                         throws IOException
        Returns a document iterator over the documents containing a term.

        Note that the index iterator returned by this method will return null on a call to term().

        Note that it is always possible to call this method with argument 0, even if the underlying index does not provide random access.

        Parameters:
        termNumber - the number of a term.
        Throws:
        UnsupportedOperationException - if this index reader is not accessible by term number.
        IOException
      • documents

        IndexIterator documents​(CharSequence term)
                         throws IOException
        Returns an index iterator over the documents containing a term; the term is given explicitly.

        Unless the term processor of the associated index is null, words coming from a query will have to be processed before being used with this method.

        Note that the index iterator returned by this method will return term on a call to term().

        Parameters:
        term - a term (the term will be downcased if the index is case insensitive).
        Throws:
        UnsupportedOperationException - if the term map is not available for the underlying index.
        IOException
      • nextIterator

        IndexIterator nextIterator()
                            throws IOException
        Returns an IndexIterator on the term after the current one (optional operation).

        Note that after creation there is no current term. Thus, the first call to this method will return an IndexIterator on the first term. As a consequence, repeated calls to this method provide a way to scan sequentially an index.

        Returns:
        the index iterator of the next term, or null if there are no more terms after the current one.
        Throws:
        IOException