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 newQueryHits
instance wrappinghits
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getSize()
This default implementation returns-1
.ScoreNode
nextScoreNode()
Returns the next score node in this QueryHits ornull
if there are no more score nodes.void
skip(int n)
Skipsn
hits.-
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 newQueryHits
instance 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:
getSize
in interfaceCloseableHits
- Overrides:
getSize
in classAbstractQueryHits
- Returns:
-1
.
-
nextScoreNode
public ScoreNode nextScoreNode() throws IOException
Returns the next score node in this QueryHits ornull
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.
-
skip
public void skip(int n) throws IOException
Skipsn
hits.- Specified by:
skip
in interfaceCloseableHits
- Overrides:
skip
in classAbstractQueryHits
- Parameters:
n
- the number of hits to skip.- Throws:
IOException
- if an error occurs while skipping.
-
-