ValueType
- public abstract class CompareQuery<ValueType>
extends org.apache.lucene.search.Query
Query
implementation that is used to apply a Comparison
constraint against the Path of nodes. This
query implementation works by using the weight and scorer
of the wrapped
query to score (and return) only those documents that correspond to nodes with Paths that satisfy the constraint.Modifier and Type | Class and Description |
---|---|
protected class |
CompareQuery.CompareScorer
A scorer for the Path query.
|
protected class |
CompareQuery.CompareWeight
Calculates query weights and builds query scores for our NOT queries.
|
protected static interface |
CompareQuery.Evaluator<ValueType> |
Modifier and Type | Field and Description |
---|---|
protected ValueType |
constraintValue |
protected CompareQuery.Evaluator<ValueType> |
evaluator |
protected String |
fieldName
The operand that is being negated by this query.
|
protected org.apache.lucene.document.FieldSelector |
fieldSelector |
protected ValueFactory<String> |
stringFactory |
protected ValueFactory<ValueType> |
valueTypeFactory |
Modifier | Constructor and Description |
---|---|
protected |
CompareQuery(String fieldName,
ValueType constraintValue,
ValueFactory<ValueType> valueTypeFactory,
ValueFactory<String> stringFactory,
CompareQuery.Evaluator<ValueType> evaluator)
Construct a
Query implementation that scores nodes according to the supplied comparator. |
protected |
CompareQuery(String fieldName,
ValueType constraintValue,
ValueFactory<ValueType> valueTypeFactory,
ValueFactory<String> stringFactory,
CompareQuery.Evaluator<ValueType> evaluator,
org.apache.lucene.document.FieldSelector fieldSelector)
Construct a
Query implementation that scores nodes according to the supplied comparator. |
Modifier and Type | Method and Description |
---|---|
org.apache.lucene.search.Weight |
createWeight(org.apache.lucene.search.Searcher searcher) |
protected ValueType |
readFromDocument(org.apache.lucene.index.IndexReader reader,
int docId) |
String |
toString(String field) |
protected final String fieldName
protected final org.apache.lucene.document.FieldSelector fieldSelector
protected final ValueType constraintValue
protected final CompareQuery.Evaluator<ValueType> evaluator
protected final ValueFactory<ValueType> valueTypeFactory
protected final ValueFactory<String> stringFactory
protected CompareQuery(String fieldName, ValueType constraintValue, ValueFactory<ValueType> valueTypeFactory, ValueFactory<String> stringFactory, CompareQuery.Evaluator<ValueType> evaluator)
Query
implementation that scores nodes according to the supplied comparator.fieldName
- the name of the document field containing the value; may not be nullconstraintValue
- the constraint value; may not be nullvalueTypeFactory
- the value factory that can be used during the scoring; may not be nullstringFactory
- the string factory that can be used during the scoring; may not be nullevaluator
- the CompareQuery.Evaluator
implementation that returns whether the node value satisfies the constraint; may not
be nullprotected CompareQuery(String fieldName, ValueType constraintValue, ValueFactory<ValueType> valueTypeFactory, ValueFactory<String> stringFactory, CompareQuery.Evaluator<ValueType> evaluator, org.apache.lucene.document.FieldSelector fieldSelector)
Query
implementation that scores nodes according to the supplied comparator.fieldName
- the name of the document field containing the value; may not be nullconstraintValue
- the constraint value; may not be nullvalueTypeFactory
- the value factory that can be used during the scoring; may not be null unless
readFromDocument(IndexReader, int)
is overloaded to not use itstringFactory
- the string factory that can be used during the scoring; may not be nullevaluator
- the CompareQuery.Evaluator
implementation that returns whether the node value satisfies the constraint; may not
be nullfieldSelector
- the field selector that should load the fields needed to recover the value; may be null if the field
selector should be generated automaticallyprotected ValueType readFromDocument(org.apache.lucene.index.IndexReader reader, int docId) throws IOException
IOException
public org.apache.lucene.search.Weight createWeight(org.apache.lucene.search.Searcher searcher)
createWeight
in class org.apache.lucene.search.Query
Query.createWeight(org.apache.lucene.search.Searcher)
Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.