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
public class RangeFacetCreator extends NestedFacetCreator
Creates a facet with a single
IntervalFacetEntrythat 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
TODO: add RangeFacetEntry with absolute min/max and selected min/maxIntervalFacetEntry.
-
-
Field Summary
Fields Modifier and Type Field Description static StringAGGREGATION_NAME-
Fields inherited from class de.cxp.ocs.elasticsearch.facets.NestedFacetCreator
nestedFacetCorrector
-
-
Constructor Summary
Constructors Constructor Description RangeFacetCreator(Map<String,FacetConfiguration.FacetConfig> facetConfigs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancorrectedNestedDocumentCount()protected Optional<Facet>createFacet(org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket facetNameBucket, FacetConfiguration.FacetConfig facetConfig, InternalResultFilter facetFilter, SearchQueryBuilder linkBuilder)protected StringgetNestedPath()protected org.elasticsearch.search.aggregations.AggregationBuildergetNestedValueAggregation(String nestedPathPrefix)protected booleanisMatchingFilterType(InternalResultFilter internalResultFilter)Optional<Facet>mergeFacets(Facet first, Facet second)Try to merge facets with same label.protected booleanonlyFetchAggregationsForConfiguredFacets()-
Methods inherited from class de.cxp.ocs.elasticsearch.facets.NestedFacetCreator
buildAggregation, buildExcludeFilteredAggregation, buildIncludeFilteredAggregation, createFacets, extractFacets
-
-
-
-
Field Detail
-
AGGREGATION_NAME
public static final String AGGREGATION_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RangeFacetCreator
public RangeFacetCreator(Map<String,FacetConfiguration.FacetConfig> facetConfigs)
-
-
Method Detail
-
getNestedPath
protected String getNestedPath()
- Specified by:
getNestedPathin classNestedFacetCreator
-
onlyFetchAggregationsForConfiguredFacets
protected boolean onlyFetchAggregationsForConfiguredFacets()
- Specified by:
onlyFetchAggregationsForConfiguredFacetsin classNestedFacetCreator
-
correctedNestedDocumentCount
protected boolean correctedNestedDocumentCount()
- Specified by:
correctedNestedDocumentCountin classNestedFacetCreator
-
isMatchingFilterType
protected boolean isMatchingFilterType(InternalResultFilter internalResultFilter)
- 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, SearchQueryBuilder linkBuilder)
- Specified by:
createFacetin classNestedFacetCreator
-
mergeFacets
public Optional<Facet> mergeFacets(Facet first, Facet second)
Description copied from interface:FacetCreatorTry to merge facets with same label. If not possible, return Optional.empty.- Returns:
-
-