Class LuceneQueryHits
- java.lang.Object
-
- org.apache.jackrabbit.core.query.lucene.LuceneQueryHits
-
- All Implemented Interfaces:
CloseableHits
,QueryHits
public class LuceneQueryHits extends Object implements QueryHits
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 LuceneQueryHits(IndexReader reader, IndexSearcher searcher, Query query)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Releases resources held by this hits instance.int
getSize()
ScoreNode
nextScoreNode()
Returns the next score node in this QueryHits ornull
if there are no more score nodes.void
skip(int n)
Skips an
score nodes.
-
-
-
Constructor Detail
-
LuceneQueryHits
public LuceneQueryHits(IndexReader reader, IndexSearcher searcher, Query query) throws IOException
- Throws:
IOException
-
-
Method Detail
-
nextScoreNode
public ScoreNode nextScoreNode() throws IOException
Returns the next score node in this QueryHits ornull
if there are no more score nodes.- Specified by:
nextScoreNode
in interfaceQueryHits
- Returns:
- the next score node in this QueryHits.
- Throws:
IOException
- if an error occurs while reading from the index.
-
close
public void close() throws IOException
Releases resources held by this hits instance.- Specified by:
close
in interfaceCloseableHits
- Throws:
IOException
- if an error occurs while releasing resources.
-
getSize
public int getSize()
- Specified by:
getSize
in interfaceCloseableHits
- Returns:
- always -1.
-
skip
public void skip(int n) throws IOException
Skips an
score nodes.- Specified by:
skip
in interfaceCloseableHits
- Parameters:
n
- the number of score nodes to skip.- Throws:
IOException
- if an error occurs while skipping.
-
-