Interface FacetCreator

All Known Implementing Classes:
CategoryFacetCreator, IndexNameFacetCreator, IntervalFacetCreator, NestedCustomFacetCreator, NestedFacetCreator, RangeFacetCreator, TermFacetCreator, VariantFacetCreator

public interface FacetCreator
  • Method Details

    • buildAggregation

      org.elasticsearch.search.aggregations.AggregationBuilder buildAggregation(FilterContext filterContext)
      Build aggregation that is necessary to create the according facets.
      Returns:
      configured aggregation-builder
    • buildIncludeFilteredAggregation

      org.elasticsearch.search.aggregations.AggregationBuilder buildIncludeFilteredAggregation(FilterContext filterContext, Set<String> includeNames)
      Build aggregation that is necessary to create the facets specified by the includes list.
      Parameters:
      includeNames - names of data fields for which the aggregations should be built
      Returns:
      configured aggregation-builder
    • buildExcludeFilteredAggregation

      org.elasticsearch.search.aggregations.AggregationBuilder buildExcludeFilteredAggregation(FilterContext filterContext, Set<String> excludeNames)
      Build aggregation that is necessary to create the facets, but not the ones in the exlude list.
      Parameters:
      excludeNames - names of data fields that MUST NOT be part of this aggregation
      Returns:
      configured aggregation-builder
    • createFacets

      Collection<Facet> createFacets(org.elasticsearch.search.aggregations.Aggregations aggResult, FilterContext filterContext, DefaultLinkBuilder linkBuilder)
      create facets from aggregation result.
      Parameters:
      aggResult - ES aggregagtion result
      filterContext - the filter context
      linkBuilder - a link builder to create facet-entry-links
      Returns:
      a list of facets that can be derived from the aggregation result
    • mergeFacets

      Optional<Facet> mergeFacets(Facet first, Facet second)
      Try to merge facets with same label. If not possible, return Optional.empty.
      Parameters:
      first - Facet A
      second - Facet B
      Returns:
      optionally a merged Facet, otherwise Optional::empty