public class CompareNameQuery extends CompareQuery<Name>
Query
implementation that is used to apply a Comparison
constraint against the name of nodes. This
query implementation works by using the weight and Weight.scorer(LeafReaderContext)
scorer} of the wrapped
query to score (and return) only those documents that correspond to nodes with Names that satisfy the constraint.CompareQuery.Evaluator<ValueType>
ConstantScoreWeightQuery.ConstantWeight, ConstantScoreWeightQuery.ConstantWeightScorer
Modifier and Type | Field and Description |
---|---|
protected static CompareQuery.Evaluator<Name> |
EQUAL_TO |
protected static CompareQuery.Evaluator<Name> |
IS_GREATER_THAN |
protected static CompareQuery.Evaluator<Name> |
IS_GREATER_THAN_OR_EQUAL_TO |
protected static CompareQuery.Evaluator<Name> |
IS_LESS_THAN |
protected static CompareQuery.Evaluator<Name> |
IS_LESS_THAN_OR_EQUAL_TO |
caseOperation, constraintValue, evaluator, stringFactory, valueTypeFactory
Modifier | Constructor and Description |
---|---|
protected |
CompareNameQuery(String field,
Name constraintValue,
ValueFactory<Name> nameFactory,
ValueFactory<String> stringFactory,
CompareQuery.Evaluator<Name> evaluator,
CaseOperations.CaseOperation caseOperation)
Construct a
Query implementation that scores nodes according to the supplied comparator. |
Modifier and Type | Method and Description |
---|---|
org.apache.lucene.search.Query |
clone() |
static org.apache.lucene.search.Query |
createQueryForNodesWithNameEqualTo(Name constraintValue,
String fieldName,
ValueFactories factories,
CaseOperations.CaseOperation caseOperation)
Construct a
Query implementation that scores documents such that the node represented by the document has a name
that is greater than the supplied constraint name. |
static CompareNameQuery |
createQueryForNodesWithNameGreaterThan(Name constraintValue,
String localNameField,
ValueFactories factories,
CaseOperations.CaseOperation caseOperation)
Construct a
Query implementation that scores documents such that the node represented by the document has a name
that is greater than the supplied constraint name. |
static CompareNameQuery |
createQueryForNodesWithNameGreaterThanOrEqualTo(Name constraintValue,
String localNameField,
ValueFactories factories,
CaseOperations.CaseOperation caseOperation)
Construct a
Query implementation that scores documents such that the node represented by the document has a name
that is greater than or equal to the supplied constraint name. |
static CompareNameQuery |
createQueryForNodesWithNameLessThan(Name constraintValue,
String localNameField,
ValueFactories factories,
CaseOperations.CaseOperation caseOperation)
Construct a
Query implementation that scores documents such that the node represented by the document has a name
that is less than the supplied constraint name. |
static CompareNameQuery |
createQueryForNodesWithNameLessThanOrEqualTo(Name constraintValue,
String localNameField,
ValueFactories factories,
CaseOperations.CaseOperation caseOperation)
Construct a
Query implementation that scores documents such that the node represented by the document has a name
that is less than or equal to the supplied constraint name. |
areValid, toString
createWeight, field
protected static final CompareQuery.Evaluator<Name> EQUAL_TO
protected static final CompareQuery.Evaluator<Name> IS_LESS_THAN
protected static final CompareQuery.Evaluator<Name> IS_LESS_THAN_OR_EQUAL_TO
protected static final CompareQuery.Evaluator<Name> IS_GREATER_THAN
protected static final CompareQuery.Evaluator<Name> IS_GREATER_THAN_OR_EQUAL_TO
protected CompareNameQuery(String field, Name constraintValue, ValueFactory<Name> nameFactory, ValueFactory<String> stringFactory, CompareQuery.Evaluator<Name> evaluator, CaseOperations.CaseOperation caseOperation)
Query
implementation that scores nodes according to the supplied comparator.field
- the name of the document field containing the local name value; may not be nullconstraintValue
- the constraint path; may not be nullnameFactory
- the value factory used during scoring; may not be nullevaluator
- the CompareQuery.Evaluator
implementation that returns whether the node path satisfies the
constraint; may not be nullcaseOperation
- the operation that should be performed on the indexed values before the constraint value is beingpublic static org.apache.lucene.search.Query createQueryForNodesWithNameEqualTo(Name constraintValue, String fieldName, ValueFactories factories, CaseOperations.CaseOperation caseOperation)
Query
implementation that scores documents such that the node represented by the document has a name
that is greater than the supplied constraint name.constraintValue
- the constraint value; may not be nullfieldName
- the name of the document field containing the name value; may not be nullfactories
- the value factories that can be used during the scoring; may not be nullcaseOperation
- the operation that should be performed on the indexed values before the constraint value is being
evaluated; may not be nullpublic static CompareNameQuery createQueryForNodesWithNameGreaterThan(Name constraintValue, String localNameField, ValueFactories factories, CaseOperations.CaseOperation caseOperation)
Query
implementation that scores documents such that the node represented by the document has a name
that is greater than the supplied constraint name.constraintValue
- the constraint value; may not be nulllocalNameField
- the name of the document field containing the local name value; may not be nullfactories
- the value factories that can be used during the scoring; may not be nullcaseOperation
- the operation that should be performed on the indexed values before the constraint value is being
evaluated; may not be nullpublic static CompareNameQuery createQueryForNodesWithNameGreaterThanOrEqualTo(Name constraintValue, String localNameField, ValueFactories factories, CaseOperations.CaseOperation caseOperation)
Query
implementation that scores documents such that the node represented by the document has a name
that is greater than or equal to the supplied constraint name.constraintValue
- the constraint value; may not be nulllocalNameField
- the name of the document field containing the local name value; may not be nullfactories
- the value factories that can be used during the scoring; may not be nullcaseOperation
- the operation that should be performed on the indexed values before the constraint value is being
evaluated; may not be nullpublic static CompareNameQuery createQueryForNodesWithNameLessThan(Name constraintValue, String localNameField, ValueFactories factories, CaseOperations.CaseOperation caseOperation)
Query
implementation that scores documents such that the node represented by the document has a name
that is less than the supplied constraint name.constraintValue
- the constraint value; may not be nulllocalNameField
- the name of the document field containing the local name value; may not be nullfactories
- the value factories that can be used during the scoring; may not be nullcaseOperation
- the operation that should be performed on the indexed values before the constraint value is being
evaluated; may not be nullpublic static CompareNameQuery createQueryForNodesWithNameLessThanOrEqualTo(Name constraintValue, String localNameField, ValueFactories factories, CaseOperations.CaseOperation caseOperation)
Query
implementation that scores documents such that the node represented by the document has a name
that is less than or equal to the supplied constraint name.constraintValue
- the constraint value; may not be nulllocalNameField
- the name of the document field containing the local name value; may not be nullfactories
- the value factories that can be used during the scoring; may not be nullcaseOperation
- the operation that should be performed on the indexed values before the constraint value is being
evaluated; may not be nullpublic org.apache.lucene.search.Query clone()
clone
in class org.apache.lucene.search.Query
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.