Package de.cxp.ocs.elasticsearch.facets
Class RangeFacetCreator
java.lang.Object
de.cxp.ocs.elasticsearch.facets.NestedFacetCreator
de.cxp.ocs.elasticsearch.facets.RangeFacetCreator
- All Implemented Interfaces:
FacetCreator
Creates a facet with a single IntervalFacetEntry
that contains the
global min and max value.
(Therefore it uses the "stats" aggregation - not the range aggregationas the
name might imply.)
At the moment, a selected filter range is represented at the returned link of
that IntervalFacetEntry
.
-
Field Summary
FieldsFields inherited from class de.cxp.ocs.elasticsearch.facets.NestedFacetCreator
nestedFacetCorrector
-
Constructor Summary
ConstructorsConstructorDescriptionRangeFacetCreator
(Map<String, FacetConfiguration.FacetConfig> facetConfigs, Function<String, FacetConfiguration.FacetConfig> defaultFacetConfigProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
createFacet
(org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket facetNameBucket, FacetConfiguration.FacetConfig facetConfig, InternalResultFilter facetFilter, DefaultLinkBuilder linkBuilder) protected String
protected org.elasticsearch.search.aggregations.AggregationBuilder
getNestedValueAggregation
(String nestedPathPrefix) protected boolean
isMatchingFilterType
(InternalResultFilter internalResultFilter) mergeFacets
(Facet first, Facet second) Try to merge facets with same label.protected boolean
Methods inherited from class de.cxp.ocs.elasticsearch.facets.NestedFacetCreator
buildAggregation, buildExcludeFilteredAggregation, buildIncludeFilteredAggregation, createFacets, extractFacets
-
Field Details
-
AGGREGATION_NAME
- See Also:
-
-
Constructor Details
-
RangeFacetCreator
public RangeFacetCreator(Map<String, FacetConfiguration.FacetConfig> facetConfigs, Function<String, FacetConfiguration.FacetConfig> defaultFacetConfigProvider)
-
-
Method Details
-
getNestedPath
- Specified by:
getNestedPath
in classNestedFacetCreator
-
onlyFetchAggregationsForConfiguredFacets
protected boolean onlyFetchAggregationsForConfiguredFacets()- Specified by:
onlyFetchAggregationsForConfiguredFacets
in classNestedFacetCreator
-
correctedNestedDocumentCount
protected boolean correctedNestedDocumentCount()- Specified by:
correctedNestedDocumentCount
in classNestedFacetCreator
-
isMatchingFilterType
- Specified by:
isMatchingFilterType
in classNestedFacetCreator
-
getNestedValueAggregation
protected org.elasticsearch.search.aggregations.AggregationBuilder getNestedValueAggregation(String nestedPathPrefix) - Specified by:
getNestedValueAggregation
in classNestedFacetCreator
-
createFacet
protected Optional<Facet> createFacet(org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket facetNameBucket, FacetConfiguration.FacetConfig facetConfig, InternalResultFilter facetFilter, DefaultLinkBuilder linkBuilder) - Specified by:
createFacet
in classNestedFacetCreator
-
mergeFacets
Description copied from interface:FacetCreator
Try to merge facets with same label. If not possible, return Optional.empty.- Parameters:
first
- Facet Asecond
- Facet B- Returns:
- optionally a merged Facet, otherwise Optional::empty
-