Package com.day.cq.search.eval
Class JcrPropertyPredicateEvaluator
java.lang.Object
com.day.cq.search.eval.AbstractPredicateEvaluator
com.day.cq.search.eval.JcrPropertyPredicateEvaluator
- All Implemented Interfaces:
PredicateEvaluator
- Direct Known Subclasses:
JcrBoolPropertyPredicateEvaluator
Matches on JCR properties and their values.
Supports facet extraction. Will provide buckets for each unique property value in the results.
Name:
propertyProperties:
- property
- relative path to property, for example
jcr:title - value
- value to check property for; follows the JCR property type to string conversions
- N_value
- use 1_value, 2_value, ... to check for multiple values (combined with OR by default, with AND if and=true) (since 5.3)
- and
- set to true for combining multiple values (N_value) with AND (since 5.3)
- operation
- "equals" for exact match (default), "unequals" for unequality comparison, "like" for using the jcr:like xpath function (optional), "not" for no match (eg. "not(@prop)" in xpath, value param will be ignored), "exists" for existence check (value can be true - property must exist, the default - or false - same as "not") , "equalsIgnoreCase" for case insensitive match, "unequalsIgnoreCase" for case insensitive unequality comparison
- depth
- number of wildcard levels underneath which the property/relative path can exist (for instance, property=size depth=2 will check node/size, node/*/size and node/*/*/size)
- Since:
- 5.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanFilter(Predicate predicate, EvaluationContext context) Returns the same as the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)method (ie.booleancanXpath(Predicate predicate, EvaluationContext context) Returns the inverted boolean value of the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)method (ie.getFacetExtractor(Predicate p, EvaluationContext context) Default implementation that always returnsnull, ie.String[]getOrderByProperties(Predicate p, EvaluationContext context) Default implementation that always returnsnull.getXPathExpression(Predicate p, EvaluationContext context) Default implementation that always returnsnull, ie.booleanincludes(Predicate p, Row row, EvaluationContext context) Default implementation that always returnstrue, ie.Methods inherited from class com.day.cq.search.eval.AbstractPredicateEvaluator
getOrderByComparator, isFiltering
-
Field Details
-
PROPERTY
- See Also:
-
VALUE
- See Also:
-
OPERATION
- See Also:
-
OP_EQUALS
- See Also:
-
OP_UNEQUALS
- See Also:
-
OP_LIKE
- See Also:
-
OP_NOT
- See Also:
-
OP_EXISTS
- See Also:
-
OP_EQUALS_IGNORE_CASE
- See Also:
-
OP_UNEQUALS_IGNORE_CASE
- See Also:
-
AND
- See Also:
-
DEPTH
- See Also:
-
STEP
- See Also:
-
MAX_NUMBER_OF_VALUES
public static final int MAX_NUMBER_OF_VALUES- See Also:
-
-
Constructor Details
-
JcrPropertyPredicateEvaluator
public JcrPropertyPredicateEvaluator()
-
-
Method Details
-
getXPathExpression
Description copied from class:AbstractPredicateEvaluatorDefault implementation that always returnsnull, ie. adds nothing to the XPath query. Subclasses can choose whether they want to implement this method or use theAbstractPredicateEvaluator.includes(Predicate, Row, EvaluationContext)method for advanced filtering (or both).- Specified by:
getXPathExpressionin interfacePredicateEvaluator- Overrides:
getXPathExpressionin classAbstractPredicateEvaluator- Parameters:
p- predicate (for this evaluator type) which is evaluatedcontext- helper class which provides access to various elements of the query evaluation- Returns:
- string containing an XPath predicateEvaluator expression
-
getOrderByProperties
Description copied from class:AbstractPredicateEvaluatorDefault implementation that always returnsnull.- Specified by:
getOrderByPropertiesin interfacePredicateEvaluator- Overrides:
getOrderByPropertiesin classAbstractPredicateEvaluator- Parameters:
p- predicate (for this evaluator type) which is evaluatedcontext- helper class which provides access to various elements of the query evaluation- Returns:
- one or multiple relative paths to JCR properties or
null
-
getFacetExtractor
Description copied from class:AbstractPredicateEvaluatorDefault implementation that always returnsnull, ie. no facets will be extracted for the predicate.- Specified by:
getFacetExtractorin interfacePredicateEvaluator- Overrides:
getFacetExtractorin classAbstractPredicateEvaluator- Parameters:
p- predicate (for this evaluator type) which is evaluatedcontext- helper class which provides access to various elements of the query evaluation- Returns:
- a
FacetExtractorthat is used to create aFacetornullif no extractor shall be provided
-
includes
Description copied from class:AbstractPredicateEvaluatorDefault implementation that always returnstrue, ie. it does not "touch" the result set at all.- Specified by:
includesin interfacePredicateEvaluator- Overrides:
includesin classAbstractPredicateEvaluator- Parameters:
p- predicate (for this evaluator type) which is evaluatedrow- current row of the result set returned through the xpath querycontext- helper class which provides access to various elements of the query evaluation- Returns:
trueif this row should be part of the final result set,falseif it should be dropped
-
canXpath
Description copied from class:AbstractPredicateEvaluatorReturns the inverted boolean value of the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)method (ie. if not overridden,true).- Specified by:
canXpathin interfacePredicateEvaluator- Overrides:
canXpathin classAbstractPredicateEvaluator- Parameters:
predicate- predicate (for this evaluator type) which is evaluatedcontext- helper class which provides access to various elements of the query evaluation- Returns:
trueif this evaluator can express itself via xpath, ie.PredicateEvaluator.getXPathExpression(Predicate, EvaluationContext)
-
canFilter
Description copied from class:AbstractPredicateEvaluatorReturns the same as the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)method (ie. if not overridden,false).- Specified by:
canFilterin interfacePredicateEvaluator- Overrides:
canFilterin classAbstractPredicateEvaluator- Parameters:
predicate- predicate (for this evaluator type) which is evaluatedcontext- helper class which provides access to various elements of the query evaluation- Returns:
trueif this evaluator can be express itself via filtering, ie.PredicateEvaluator.includes(Predicate, Row, EvaluationContext)
-