org.modeshape.search.lucene.query
Class IdsQuery

java.lang.Object
  extended by org.apache.lucene.search.Query
      extended by org.modeshape.search.lucene.query.IdsQuery
All Implemented Interfaces:
Serializable, Cloneable

public class IdsQuery
extends org.apache.lucene.search.Query

A Lucene Query implementation that is used to score positively those documents that have a ID in the supplied set. This works for large sets of IDs; in smaller numbers, it may be more efficient to create a boolean query that checks for each of the IDs.

See Also:
Serialized Form

Constructor Summary
IdsQuery(String fieldName, Set<String> ids)
          Construct a Query implementation that scores nodes according to the supplied comparator.
 
Method Summary
 org.apache.lucene.search.Weight createWeight(org.apache.lucene.search.Searcher searcher)
          
 String toString(String field)
          
 
Methods inherited from class org.apache.lucene.search.Query
clone, combine, equals, extractTerms, getBoost, getSimilarity, hashCode, mergeBooleanQueries, rewrite, setBoost, toString, weight
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IdsQuery

public IdsQuery(String fieldName,
                Set<String> ids)
Construct a Query implementation that scores nodes according to the supplied comparator.

Parameters:
fieldName - the name of the document field containing the value; may not be null
ids - the set of ID values; may not be null
Method Detail

createWeight

public org.apache.lucene.search.Weight createWeight(org.apache.lucene.search.Searcher searcher)

Overrides:
createWeight in class org.apache.lucene.search.Query
See Also:
Query.createWeight(org.apache.lucene.search.Searcher)

toString

public String toString(String field)

Specified by:
toString in class org.apache.lucene.search.Query
See Also:
Query.toString(java.lang.String)


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.