ModeShape Distribution 3.2.0.Final

org.modeshape.jcr.query.lucene
Class IdsQuery

java.lang.Object
  extended by org.apache.lucene.search.Query
      extended by org.modeshape.jcr.query.lucene.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

Nested Class Summary
protected  class IdsQuery.IdScorer
          A scorer for the Path query.
protected  class IdsQuery.IdSetWeight
          Calculates query weights and builds query scores for our NOT queries.
 
Field Summary
protected  String fieldName
           
protected  org.apache.lucene.document.FieldSelector fieldSelector
           
protected  Set<String> uuids
          The operand that is being negated by this query.
 
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)
          
protected  boolean includeDocument(org.apache.lucene.index.IndexReader reader, int docId)
           
 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
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

uuids

protected final Set<String> uuids
The operand that is being negated by this query.


fieldSelector

protected final org.apache.lucene.document.FieldSelector fieldSelector

fieldName

protected final String fieldName
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

includeDocument

protected boolean includeDocument(org.apache.lucene.index.IndexReader reader,
                                  int docId)
                           throws IOException
Throws:
IOException

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)

ModeShape Distribution 3.2.0.Final

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