Class SortedLuceneQueryHits

  • All Implemented Interfaces:
    CloseableHits, QueryHits

    public final class SortedLuceneQueryHits
    extends AbstractQueryHits
    Wraps a lucene query result and adds a close method that allows to release resources after a query has been executed and the results have been read completely.
    • Constructor Detail

      • SortedLuceneQueryHits

        public SortedLuceneQueryHits​(org.apache.lucene.search.IndexSearcher searcher,
                                     org.apache.lucene.search.Query query,
                                     org.apache.lucene.search.Sort sort,
                                     long resultFetchHint)
                              throws IOException
        Creates a new QueryHits instance wrapping hits.
        Parameters:
        searcher - the index searcher.
        query - the query to execute.
        sort - the sort criteria.
        resultFetchHint - a hint on how many results should be pre-fetched from the lucene index.
        Throws:
        IOException - if an error occurs while reading from the index.
    • Method Detail

      • nextScoreNode

        public ScoreNode nextScoreNode()
                                throws IOException
        Returns the next score node in this QueryHits or null if there are no more score nodes.
        Returns:
        the next score node in this QueryHits.
        Throws:
        IOException - if an error occurs while reading from the index.