org.modeshape.jcr.query.lucene
Class IdsQuery
java.lang.Object
org.apache.lucene.search.Query
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. |
Constructor Summary |
IdsQuery(String fieldName,
Set<String> ids)
Construct a Query implementation that scores nodes according to the supplied comparator. |
Methods inherited from class org.apache.lucene.search.Query |
clone, combine, equals, extractTerms, getBoost, getSimilarity, hashCode, mergeBooleanQueries, rewrite, setBoost, toString, weight |
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
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 nullids
- the set of ID values; may not be null
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)
Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.