Package com.day.cq.search.eval
Class PredicateGroupEvaluator
- java.lang.Object
 - 
- com.day.cq.search.eval.AbstractPredicateEvaluator
 - 
- com.day.cq.search.eval.PredicateGroupEvaluator
 
 
 
- 
- All Implemented Interfaces:
 PredicateEvaluator
- Direct Known Subclasses:
 SavedQueryPredicate
public class PredicateGroupEvaluator extends AbstractPredicateEvaluator
Allows to build nested conditions. Groups can contain nested groups. Everything in a querybuilder query is implicitly in a root group, which can havep.orandp.notas well.Example for matching either one of two properties against a value:
group.p.or=true group.1_property=jcr:title group.1_property.value=My Page group.2_property=navTitle group.2_property.value=My PageThis is conceptually(1_property OR 2_property).Example for nested groups:
fulltext=Management group.p.or=true group.1_group.path=/content/geometrixx/en group.1_group.type=cq:Page group.2_group.path=/content/dam/geometrixx group.2_group.type=dam:AssetThis searches for the term "Management" within pages in /content/geometrixx/en or in assets in /content/dam/geometrixx. This is conceptuallyfulltext AND ( (path AND type) OR (path AND type) ). Be aware that such OR joins need good indexes for performance.Name:
groupProperties:
- p.or
 - if set to "true", only one predicate in the group must match (defaults to "false", meaning all must match)
 - p.not
 - if set to "true", negates the group (defaults to "false")
 - <predicate>
 - add nested predicates
 - N_<predicate>
 - add multiple nested predicates of the same time, e.g. 1_property, 2_property, ...
 
- Since:
 - 5.2
 
 
- 
- 
Constructor Summary
Constructors Constructor Description PredicateGroupEvaluator() 
- 
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 predicate, EvaluationContext context)Default implementation that always returnsnull, ie.java.lang.StringgetXPathExpression(Predicate p, EvaluationContext context)Default implementation that always returnsnull, ie.booleanincludes(Predicate p, javax.jcr.query.Row row, EvaluationContext context)Default implementation that always returnstrue, ie.java.lang.StringlistFilteringPredicates(PredicateGroup group, EvaluationContext context)- 
Methods inherited from class com.day.cq.search.eval.AbstractPredicateEvaluator
getOrderByComparator, getOrderByProperties, isFiltering 
 - 
 
 - 
 
- 
- 
Method Detail
- 
getXPathExpression
public java.lang.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
 
 
- 
includes
public boolean includes(Predicate p, javax.jcr.query.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)
 
- 
listFilteringPredicates
public java.lang.String listFilteringPredicates(PredicateGroup group, EvaluationContext context)
 
- 
getFacetExtractor
public FacetExtractor getFacetExtractor(Predicate predicate, 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:
 predicate- 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 
 
 - 
 
 -