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
public class JcrPropertyPredicateEvaluator extends AbstractPredicateEvaluator
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
Fields Modifier and Type Field Description static StringANDstatic StringDEPTHstatic intMAX_NUMBER_OF_VALUESstatic StringOP_EQUALSstatic StringOP_EQUALS_IGNORE_CASEstatic StringOP_EXISTSstatic StringOP_LIKEstatic StringOP_NOTstatic StringOP_UNEQUALSstatic StringOP_UNEQUALS_IGNORE_CASEstatic StringOPERATIONstatic StringPROPERTYstatic StringSTEPstatic StringVALUE
-
Constructor Summary
Constructors Constructor Description JcrPropertyPredicateEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanFilter(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.FacetExtractorgetFacetExtractor(Predicate p, EvaluationContext context)Default implementation that always returnsnull, ie.String[]getOrderByProperties(Predicate p, EvaluationContext context)Default implementation that always returnsnull.StringgetXPathExpression(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 Detail
-
PROPERTY
public static final String PROPERTY
- See Also:
- Constant Field Values
-
VALUE
public static final String VALUE
- See Also:
- Constant Field Values
-
OPERATION
public static final String OPERATION
- See Also:
- Constant Field Values
-
OP_EQUALS
public static final String OP_EQUALS
- See Also:
- Constant Field Values
-
OP_UNEQUALS
public static final String OP_UNEQUALS
- See Also:
- Constant Field Values
-
OP_LIKE
public static final String OP_LIKE
- See Also:
- Constant Field Values
-
OP_NOT
public static final String OP_NOT
- See Also:
- Constant Field Values
-
OP_EXISTS
public static final String OP_EXISTS
- See Also:
- Constant Field Values
-
OP_EQUALS_IGNORE_CASE
public static final String OP_EQUALS_IGNORE_CASE
- See Also:
- Constant Field Values
-
OP_UNEQUALS_IGNORE_CASE
public static final String OP_UNEQUALS_IGNORE_CASE
- See Also:
- Constant Field Values
-
AND
public static final String AND
- See Also:
- Constant Field Values
-
DEPTH
public static final String DEPTH
- See Also:
- Constant Field Values
-
STEP
public static final String STEP
- See Also:
- Constant Field Values
-
MAX_NUMBER_OF_VALUES
public static final int MAX_NUMBER_OF_VALUES
- See Also:
- Constant Field Values
-
-
Method Detail
-
getXPathExpression
public String getXPathExpression(Predicate p, EvaluationContext context)
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
public String[] getOrderByProperties(Predicate p, EvaluationContext context)
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
public FacetExtractor getFacetExtractor(Predicate p, EvaluationContext context)
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
public boolean includes(Predicate p, Row row, EvaluationContext context)
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
public boolean canXpath(Predicate predicate, EvaluationContext context)
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
public boolean canFilter(Predicate predicate, EvaluationContext context)
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)
-
-