org.apache.jackrabbit.core.query.lucene
Class LuceneQueryHits

java.lang.Object
  extended by 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
LuceneQueryHits(org.apache.lucene.index.IndexReader reader, org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.search.Query query)
           
 
Method Summary
 void close()
          Releases resources held by this hits instance.
 int getSize()
           
 ScoreNode nextScoreNode()
          Returns the next score node in this QueryHits or null if there are no more score nodes.
 void skip(int n)
          Skips a n score nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneQueryHits

public LuceneQueryHits(org.apache.lucene.index.IndexReader reader,
                       org.apache.lucene.search.IndexSearcher searcher,
                       org.apache.lucene.search.Query query)
                throws IOException
Throws:
IOException
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.

Specified by:
nextScoreNode in interface QueryHits
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 interface CloseableHits
Throws:
IOException - if an error occurs while releasing resources.

getSize

public int getSize()
Specified by:
getSize in interface CloseableHits
Returns:
always -1.

skip

public void skip(int n)
          throws IOException
Skips a n score nodes.

Specified by:
skip in interface CloseableHits
Parameters:
n - the number of score nodes to skip.
Throws:
IOException - if an error occurs while skipping.


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.