ValueType - the actual value type used by the query@Immutable public abstract class CompareQuery<ValueType> extends ConstantScoreWeightQuery
Query implementation that is used to apply a Comparison constraint against the indexed nodes.
This should only be used when the data stored in the indexes for ValueType is a String.
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
CompareQuery.Evaluator<ValueType> |
| Modifier and Type | Field and Description |
|---|---|
protected CaseOperations.CaseOperation |
caseOperation |
protected ValueType |
constraintValue
The operand that is being negated by this query.
|
protected CompareQuery.Evaluator<ValueType> |
evaluator |
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,
CaseOperations.CaseOperation caseOperation)
Construct a
Query implementation that scores nodes according to the supplied comparator. |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
areValid(org.apache.lucene.index.IndexableField... fields)
Checks if the given fields are valid for the document matched by a particular query or not.
|
String |
toString(String field) |
createWeight, fieldprotected final ValueType constraintValue
protected final CompareQuery.Evaluator<ValueType> evaluator
protected final ValueFactory<ValueType> valueTypeFactory
protected final ValueFactory<String> stringFactory
protected final CaseOperations.CaseOperation caseOperation
protected CompareQuery(String fieldName, ValueType constraintValue, ValueFactory<ValueType> valueTypeFactory, ValueFactory<String> stringFactory, CompareQuery.Evaluator<ValueType> evaluator, CaseOperations.CaseOperation caseOperation)
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 nullcaseOperation - the operation that should be performed on the indexed values before the constraint value is being
evaluated; may not be nullprotected boolean areValid(org.apache.lucene.index.IndexableField... fields)
ConstantScoreWeightQueryareValid in class ConstantScoreWeightQueryfields - a IndexableField array instance which was loaded by the scorer for the current field; never null
and never empty.true if the array of fields is valid and document should be returned by the query or false if not.Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.