Class DistinctValuesFacetExtractor
- java.lang.Object
-
- com.day.cq.search.facets.extractors.PropertyFacetExtractor
-
- com.day.cq.search.facets.extractors.DistinctValuesFacetExtractor
-
- All Implemented Interfaces:
FacetExtractor
public class DistinctValuesFacetExtractor extends PropertyFacetExtractor
DistinctBucketsFacetExtractor
automatically extracts buckets based on distinct values for given properties (or node paths) in the result.- Since:
- 5.2
-
-
Constructor Summary
Constructors Constructor Description DistinctValuesFacetExtractor(java.lang.String propertyRelPath, java.lang.String valueFilter, Predicate predicateTemplate, java.lang.String valueParameterName)
Creates a new facet extractor with the givenvalueFilter
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Facet
getFacet()
Called after the result set was scanned (andFacetExtractor.handleNode(Node)
was called for each node in the result) to retrieve the finalFacet
object.int
hashCode()
-
Methods inherited from class com.day.cq.search.facets.extractors.PropertyFacetExtractor
handleNode
-
-
-
-
Constructor Detail
-
DistinctValuesFacetExtractor
public DistinctValuesFacetExtractor(java.lang.String propertyRelPath, java.lang.String valueFilter, Predicate predicateTemplate, java.lang.String valueParameterName)
Creates a new facet extractor with the givenvalueFilter
. The values for this facet are based on the property values referenced bypropertyRelPath
. ApredicateTemplate
must be given which for each detected bucket will be cloned and filled with the specific value of the bucket; the value will be placed in the parameter of the predicate given byvalueParameterName
.- Parameters:
propertyRelPath
- a relative path that points to a property. The relative path is based on the path of the result nodes.valueFilter
- a regular expression to only select property values matching the expression and add each matching group as one value ornull
to use the property value(s) as is.predicateTemplate
- the predicate template, which will be cloned and filled with the specific value for each bucketvalueParameterName
- name of the parameter in thepredicateTemplate
to set with the value for the bucket
-
-
Method Detail
-
getFacet
public Facet getFacet()
Description copied from interface:FacetExtractor
Called after the result set was scanned (andFacetExtractor.handleNode(Node)
was called for each node in the result) to retrieve the finalFacet
object. Please note that this might be called withoutFacetExtractor.handleNode(Node)
ever being called, if the result was empty.Implementations can use the simple
FacetImpl
implementation of theFacet
interface.- Returns:
- an implementation of the
Facet
interface with all buckets found in the result ornull
if nothing was found in the result
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-