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
DistinctBucketsFacetExtractorautomatically 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 booleanequals(java.lang.Object obj)FacetgetFacet()Called after the result set was scanned (andFacetExtractor.handleNode(Node)was called for each node in the result) to retrieve the finalFacetobject.inthashCode()- 
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. ApredicateTemplatemust 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 ornullto 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 thepredicateTemplateto set with the value for the bucket
 
 - 
 
- 
Method Detail
- 
getFacet
public Facet getFacet()
Description copied from interface:FacetExtractorCalled after the result set was scanned (andFacetExtractor.handleNode(Node)was called for each node in the result) to retrieve the finalFacetobject. Please note that this might be called withoutFacetExtractor.handleNode(Node)ever being called, if the result was empty.Implementations can use the simple
FacetImplimplementation of theFacetinterface.- Returns:
 - an implementation of the 
Facetinterface with all buckets found in the result ornullif nothing was found in the result 
 
- 
equals
public boolean equals(java.lang.Object obj)
- Overrides:
 equalsin classjava.lang.Object
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classjava.lang.Object
 
 - 
 
 -