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 voidclose()Releases resources held by this hits instance.intgetSize()ScoreNodenextScoreNode()Returns the next score node in this QueryHits ornullif there are no more score nodes.voidskip(int n)Skips anscore 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 ornullif there are no more score nodes.- Specified by:
nextScoreNodein 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 IOExceptionReleases resources held by this hits instance.- Specified by:
closein interfaceCloseableHits- Throws:
IOException- if an error occurs while releasing resources.
-
getSize
public int getSize()
- Specified by:
getSizein interfaceCloseableHits- Returns:
- always -1.
-
skip
public void skip(int n) throws IOExceptionSkips anscore nodes.- Specified by:
skipin interfaceCloseableHits- Parameters:
n- the number of score nodes to skip.- Throws:
IOException- if an error occurs while skipping.
-
-