Package com.day.cq.search.eval
Class SimilarityPredicateEvaluator
- java.lang.Object
-
- com.day.cq.search.eval.AbstractPredicateEvaluator
-
- com.day.cq.search.eval.SimilarityPredicateEvaluator
-
- All Implemented Interfaces:
PredicateEvaluator
public class SimilarityPredicateEvaluator extends AbstractPredicateEvaluator
Similarity search using JCR XPath'srep:similar()
.Does not support filtering. Does not support facet extraction.
Name:
similarProperties:
- similar
- absolute path to the node for which to find similar nodes
- local
- a relative path to a descendant node or . for the current node (optional, default is ".")
- Since:
- 5.2
-
-
Constructor Summary
Constructors Constructor Description SimilarityPredicateEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canFilter(Predicate p, EvaluationContext context)
Returns the same as the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)
method (ie.boolean
canXpath(Predicate p, EvaluationContext context)
Returns the inverted boolean value of the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)
method (ie.java.lang.String
getXPathExpression(Predicate p, EvaluationContext context)
Default implementation that always returnsnull
, ie.-
Methods inherited from class com.day.cq.search.eval.AbstractPredicateEvaluator
getFacetExtractor, getOrderByComparator, getOrderByProperties, includes, isFiltering
-
-
-
-
Field Detail
-
SIMILAR
public static final java.lang.String SIMILAR
- See Also:
- Constant Field Values
-
LOCAL
public static final java.lang.String LOCAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getXPathExpression
public java.lang.String getXPathExpression(Predicate p, EvaluationContext context)
Description copied from class:AbstractPredicateEvaluator
Default 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:
getXPathExpression
in interfacePredicateEvaluator
- Overrides:
getXPathExpression
in 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
-
canXpath
public boolean canXpath(Predicate p, EvaluationContext context)
Description copied from class:AbstractPredicateEvaluator
Returns the inverted boolean value of the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)
method (ie. if not overridden,true
).- Specified by:
canXpath
in interfacePredicateEvaluator
- Overrides:
canXpath
in classAbstractPredicateEvaluator
- Parameters:
p
- predicate (for this evaluator type) which is evaluatedcontext
- helper class which provides access to various elements of the query evaluation- Returns:
true
if this evaluator can express itself via xpath, ie.PredicateEvaluator.getXPathExpression(Predicate, EvaluationContext)
-
canFilter
public boolean canFilter(Predicate p, EvaluationContext context)
Description copied from class:AbstractPredicateEvaluator
Returns the same as the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)
method (ie. if not overridden,false
).- Specified by:
canFilter
in interfacePredicateEvaluator
- Overrides:
canFilter
in classAbstractPredicateEvaluator
- Parameters:
p
- predicate (for this evaluator type) which is evaluatedcontext
- helper class which provides access to various elements of the query evaluation- Returns:
true
if this evaluator can be express itself via filtering, ie.PredicateEvaluator.includes(Predicate, Row, EvaluationContext)
-
-