Package de.cxp.ocs.elasticsearch.facets
Class VariantFacetCreator
java.lang.Object
de.cxp.ocs.elasticsearch.facets.VariantFacetCreator
- All Implemented Interfaces:
FacetCreator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.elasticsearch.search.aggregations.AggregationBuilder_buildAggregation(Function<FacetCreator, org.elasticsearch.search.aggregations.AggregationBuilder> subAggCreatorCall) org.elasticsearch.search.aggregations.AggregationBuilderbuildAggregation(FilterContext filterContext) Build aggregation that is necessary to create the according facets.org.elasticsearch.search.aggregations.AggregationBuilderbuildExcludeFilteredAggregation(FilterContext filterContext, Set<String> excludeNames) Build aggregation that is necessary to create the facets, but not the ones in the exlude list.org.elasticsearch.search.aggregations.AggregationBuilderbuildIncludeFilteredAggregation(FilterContext filterContext, Set<String> includeNames) Build aggregation that is necessary to create the facets specified by the includes list.createFacets(org.elasticsearch.search.aggregations.Aggregations aggResult, FilterContext filterContext, DefaultLinkBuilder linkBuilder) create facets from aggregation result.mergeFacets(Facet first, Facet second) Try to merge facets with same label.
-
Constructor Details
-
VariantFacetCreator
-
-
Method Details
-
buildAggregation
public org.elasticsearch.search.aggregations.AggregationBuilder buildAggregation(FilterContext filterContext) Description copied from interface:FacetCreatorBuild aggregation that is necessary to create the according facets.- Specified by:
buildAggregationin interfaceFacetCreator- Returns:
- configured aggregation-builder
-
buildIncludeFilteredAggregation
public org.elasticsearch.search.aggregations.AggregationBuilder buildIncludeFilteredAggregation(FilterContext filterContext, Set<String> includeNames) Description copied from interface:FacetCreatorBuild aggregation that is necessary to create the facets specified by the includes list.- Specified by:
buildIncludeFilteredAggregationin interfaceFacetCreator- Parameters:
includeNames- names of data fields for which the aggregations should be built- Returns:
- configured aggregation-builder
-
buildExcludeFilteredAggregation
public org.elasticsearch.search.aggregations.AggregationBuilder buildExcludeFilteredAggregation(FilterContext filterContext, Set<String> excludeNames) Description copied from interface:FacetCreatorBuild aggregation that is necessary to create the facets, but not the ones in the exlude list.- Specified by:
buildExcludeFilteredAggregationin interfaceFacetCreator- Parameters:
excludeNames- names of data fields that MUST NOT be part of this aggregation- Returns:
- configured aggregation-builder
-
_buildAggregation
public org.elasticsearch.search.aggregations.AggregationBuilder _buildAggregation(Function<FacetCreator, org.elasticsearch.search.aggregations.AggregationBuilder> subAggCreatorCall) -
createFacets
public Collection<Facet> createFacets(org.elasticsearch.search.aggregations.Aggregations aggResult, FilterContext filterContext, DefaultLinkBuilder linkBuilder) Description copied from interface:FacetCreatorcreate facets from aggregation result.- Specified by:
createFacetsin interfaceFacetCreator- Parameters:
aggResult- ES aggregagtion resultfilterContext- the filter contextlinkBuilder- a link builder to create facet-entry-links- Returns:
- a list of facets that can be derived from the aggregation result
-
mergeFacets
Description copied from interface:FacetCreatorTry to merge facets with same label. If not possible, return Optional.empty.- Specified by:
mergeFacetsin interfaceFacetCreator- Parameters:
first- Facet Asecond- Facet B- Returns:
- optionally a merged Facet, otherwise Optional::empty
-