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 booleancreateFacet(org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket facetNameBucket, FacetConfiguration.FacetConfig facetConfig, InternalResultFilter facetFilter, DefaultLinkBuilder linkBuilder) protected Stringprotected org.elasticsearch.search.aggregations.AggregationBuildergetNestedValueAggregation(String nestedPathPrefix) protected booleanisMatchingFilterType(InternalResultFilter internalResultFilter) mergeFacets(Facet first, Facet second) Try to merge facets with same label.protected booleanMethods 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:
getNestedPathin classNestedFacetCreator
-
onlyFetchAggregationsForConfiguredFacets
protected boolean onlyFetchAggregationsForConfiguredFacets()- Specified by:
onlyFetchAggregationsForConfiguredFacetsin classNestedFacetCreator
-
correctedNestedDocumentCount
protected boolean correctedNestedDocumentCount()- Specified by:
correctedNestedDocumentCountin classNestedFacetCreator
-
isMatchingFilterType
- Specified by:
isMatchingFilterTypein classNestedFacetCreator
-
getNestedValueAggregation
protected org.elasticsearch.search.aggregations.AggregationBuilder getNestedValueAggregation(String nestedPathPrefix) - Specified by:
getNestedValueAggregationin classNestedFacetCreator
-
createFacet
protected Optional<Facet> createFacet(org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket facetNameBucket, FacetConfiguration.FacetConfig facetConfig, InternalResultFilter facetFilter, DefaultLinkBuilder linkBuilder) - Specified by:
createFacetin classNestedFacetCreator
-
mergeFacets
Description copied from interface:FacetCreatorTry 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
-