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

java.lang.Object
  extended by org.apache.lucene.search.Query
      extended by org.apache.jackrabbit.core.query.lucene.QueryHitsQuery
All Implemented Interfaces:
Serializable, Cloneable, JackrabbitQuery

public class QueryHitsQuery
extends org.apache.lucene.search.Query
implements JackrabbitQuery

QueryHitsQuery exposes a QueryHits implementation again as a Lucene Query.

See Also:
Serialized Form

Nested Class Summary
 class QueryHitsQuery.QueryHitsQueryScorer
          the scorer implementation for this query.
 class QueryHitsQuery.QueryHitsQueryWeight
          The Weight implementation for this query.
 
Constructor Summary
QueryHitsQuery(QueryHits hits)
          Creates a new query based on QueryHits.
 
Method Summary
protected  org.apache.lucene.search.Weight createWeight(org.apache.lucene.search.Searcher searcher)
          
 QueryHits execute(JackrabbitIndexSearcher searcher, SessionImpl session, org.apache.lucene.search.Sort sort)
          Executes this query and returns QueryHits or null if this query should be executed using the regular Lucene API.
 void extractTerms(Set terms)
          
 String toString(String field)
          
 
Methods inherited from class org.apache.lucene.search.Query
clone, combine, getBoost, getSimilarity, mergeBooleanQueries, rewrite, setBoost, toString, weight
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryHitsQuery

public QueryHitsQuery(QueryHits hits)
Creates a new query based on QueryHits.

Parameters:
hits - the query hits.
Method Detail

createWeight

protected org.apache.lucene.search.Weight createWeight(org.apache.lucene.search.Searcher searcher)
                                                throws IOException

Overrides:
createWeight in class org.apache.lucene.search.Query
Throws:
IOException

toString

public String toString(String field)

Specified by:
toString in class org.apache.lucene.search.Query

extractTerms

public void extractTerms(Set terms)

Overrides:
extractTerms in class org.apache.lucene.search.Query

execute

public QueryHits execute(JackrabbitIndexSearcher searcher,
                         SessionImpl session,
                         org.apache.lucene.search.Sort sort)
                  throws IOException
Executes this query and returns QueryHits or null if this query should be executed using the regular Lucene API.

Important note: an implementation must not call JackrabbitIndexSearcher#execute(Query, Sort, long) with this query instance as a parameter, otherwise a stack overflow will occur.

Specified by:
execute in interface JackrabbitQuery
Parameters:
searcher - the jackrabbit index searcher.
session - the session that executes the query.
sort - the sort criteria that must be reflected in the returned QueryHits.
Returns:
the query hits or null if the regular Lucene API should be used by the caller.
Throws:
IOException - if an error occurs while executing the query.


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