Class PredefinedBucketsFacetExtractor
java.lang.Object
com.day.cq.search.facets.extractors.PropertyFacetExtractor
com.day.cq.search.facets.extractors.PredefinedBucketsFacetExtractor
- All Implemented Interfaces:
FacetExtractor
PredefinedBucketsFacetExtractor extracts facets based on a list
of
predefined buckets. This means that the buckets
returned will at most be the ones added in the
constructor or
through addPredefinedBucket(PredefinedBucket), but could be less,
because only buckets with at least one match will be returned in the facet.- Since:
- 5.2
-
Constructor Summary
ConstructorsConstructorDescriptionPredefinedBucketsFacetExtractor(String propertyRelPath) PredefinedBucketsFacetExtractor(String propertyRelPath, Collection<? extends PredefinedBucket> buckets) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPredefinedBucket(PredefinedBucket bucket) Adds a predefined bucket to this extractor.booleangetFacet()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 Details
-
PredefinedBucketsFacetExtractor
-
PredefinedBucketsFacetExtractor
public PredefinedBucketsFacetExtractor(String propertyRelPath, Collection<? extends PredefinedBucket> buckets)
-
-
Method Details
-
addPredefinedBucket
Adds a predefined bucket to this extractor.- Parameters:
definition- the bucket definition to add.
-
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
-
hashCode
public int hashCode()
-