public class ComparePathQuery extends CompareQuery<Path>
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.CompareQuery.CompareScorer, CompareQuery.CompareWeight, CompareQuery.Evaluator<ValueType>
Modifier and Type | Field and Description |
---|---|
protected static CompareQuery.Evaluator<Path> |
PATH_IS_GREATER_THAN |
protected static CompareQuery.Evaluator<Path> |
PATH_IS_GREATER_THAN_OR_EQUAL_TO |
protected static CompareQuery.Evaluator<Path> |
PATH_IS_LESS_THAN |
protected static CompareQuery.Evaluator<Path> |
PATH_IS_LESS_THAN_OR_EQUAL_TO |
constraintValue, evaluator, fieldName, fieldSelector, stringFactory, valueTypeFactory
Modifier | Constructor and Description |
---|---|
protected |
ComparePathQuery(String fieldName,
Path constraintPath,
ValueFactory<Path> pathFactory,
ValueFactory<String> stringFactory,
CompareQuery.Evaluator<Path> evaluator,
CaseOperations.CaseOperation caseOperation)
Construct a
Query implementation that scores nodes according to the supplied comparator. |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
static ComparePathQuery |
createQueryForNodesWithPathGreaterThan(Path constraintPath,
String fieldName,
ValueFactories factories,
CaseOperations.CaseOperation caseOperation)
Construct a
Query implementation that scores documents such that the node represented by the document has a path
that is greater than the supplied constraint path. |
static ComparePathQuery |
createQueryForNodesWithPathGreaterThanOrEqualTo(Path constraintPath,
String fieldName,
ValueFactories factories,
CaseOperations.CaseOperation caseOperation)
Construct a
Query implementation that scores documents such that the node represented by the document has a path
that is greater than or equal to the supplied constraint path. |
static ComparePathQuery |
createQueryForNodesWithPathLessThan(Path constraintPath,
String fieldName,
ValueFactories factories,
CaseOperations.CaseOperation caseOperation)
Construct a
Query implementation that scores documents such that the node represented by the document has a path
that is less than the supplied constraint path. |
static ComparePathQuery |
createQueryForNodesWithPathLessThanOrEqualTo(Path constraintPath,
String fieldName,
ValueFactories factories,
CaseOperations.CaseOperation caseOperation)
Construct a
Query implementation that scores documents such that the node represented by the document has a path
that is less than or equal to the supplied constraint path. |
protected Path |
readFromDocument(org.apache.lucene.index.IndexReader reader,
int docId) |
createWeight, toString
protected static final CompareQuery.Evaluator<Path> PATH_IS_LESS_THAN
protected static final CompareQuery.Evaluator<Path> PATH_IS_LESS_THAN_OR_EQUAL_TO
protected static final CompareQuery.Evaluator<Path> PATH_IS_GREATER_THAN
protected static final CompareQuery.Evaluator<Path> PATH_IS_GREATER_THAN_OR_EQUAL_TO
protected ComparePathQuery(String fieldName, Path constraintPath, ValueFactory<Path> pathFactory, ValueFactory<String> stringFactory, CompareQuery.Evaluator<Path> evaluator, CaseOperations.CaseOperation caseOperation)
Query
implementation that scores nodes according to the supplied comparator.fieldName
- the name of the document field containing the path value; may not be nullconstraintPath
- the constraint path; may not be nullpathFactory
- 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 path 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 nullpublic static ComparePathQuery createQueryForNodesWithPathGreaterThan(Path constraintPath, String fieldName, ValueFactories factories, CaseOperations.CaseOperation caseOperation)
Query
implementation that scores documents such that the node represented by the document has a path
that is greater than the supplied constraint path.constraintPath
- the constraint path; may not be nullfieldName
- the name of the document field containing the path 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 ComparePathQuery createQueryForNodesWithPathGreaterThanOrEqualTo(Path constraintPath, String fieldName, ValueFactories factories, CaseOperations.CaseOperation caseOperation)
Query
implementation that scores documents such that the node represented by the document has a path
that is greater than or equal to the supplied constraint path.constraintPath
- the constraint path; may not be nullfieldName
- the name of the document field containing the path 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 ComparePathQuery createQueryForNodesWithPathLessThan(Path constraintPath, String fieldName, ValueFactories factories, CaseOperations.CaseOperation caseOperation)
Query
implementation that scores documents such that the node represented by the document has a path
that is less than the supplied constraint path.constraintPath
- the constraint path; may not be nullfieldName
- the name of the document field containing the path 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 ComparePathQuery createQueryForNodesWithPathLessThanOrEqualTo(Path constraintPath, String fieldName, ValueFactories factories, CaseOperations.CaseOperation caseOperation)
Query
implementation that scores documents such that the node represented by the document has a path
that is less than or equal to the supplied constraint path.constraintPath
- the constraint path; may not be nullfieldName
- the name of the document field containing the path 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 nullprotected Path readFromDocument(org.apache.lucene.index.IndexReader reader, int docId) throws IOException
readFromDocument
in class CompareQuery<Path>
IOException
public Object clone()
clone
in class org.apache.lucene.search.Query
Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.