Class SortedLuceneQueryHits
- java.lang.Object
-
- org.apache.jackrabbit.core.query.lucene.AbstractQueryHits
-
- org.apache.jackrabbit.core.query.lucene.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 Summary
Constructors Constructor Description SortedLuceneQueryHits(IndexSearcher searcher, Query query, Sort sort, long resultFetchHint)Creates a newQueryHitsinstance wrappinghits.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetSize()This default implementation returns-1.ScoreNodenextScoreNode()Returns the next score node in this QueryHits ornullif there are no more score nodes.voidskip(int n)Skipsnhits.-
Methods inherited from class org.apache.jackrabbit.core.query.lucene.AbstractQueryHits
close
-
-
-
-
Constructor Detail
-
SortedLuceneQueryHits
public SortedLuceneQueryHits(IndexSearcher searcher, Query query, Sort sort, long resultFetchHint) throws IOException
Creates a newQueryHitsinstance wrappinghits.- 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
-
getSize
public int getSize()
This default implementation returns-1.- Specified by:
getSizein interfaceCloseableHits- Overrides:
getSizein classAbstractQueryHits- Returns:
-1.
-
nextScoreNode
public ScoreNode nextScoreNode() throws IOException
Returns the next score node in this QueryHits ornullif 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.
-
skip
public void skip(int n) throws IOExceptionSkipsnhits.- Specified by:
skipin interfaceCloseableHits- Overrides:
skipin classAbstractQueryHits- Parameters:
n- the number of hits to skip.- Throws:
IOException- if an error occurs while skipping.
-
-