Package de.cxp.ocs.elasticsearch.facets
Class VariantFacetCreator
- java.lang.Object
-
- de.cxp.ocs.elasticsearch.facets.VariantFacetCreator
-
- All Implemented Interfaces:
FacetCreator
public class VariantFacetCreator extends Object implements FacetCreator
-
-
Constructor Summary
Constructors Constructor Description VariantFacetCreator(Collection<FacetCreator> creators)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.elasticsearch.search.aggregations.AggregationBuilder_buildAggregation(Function<FacetCreator,org.elasticsearch.search.aggregations.AggregationBuilder> subAggCreatorCall)org.elasticsearch.search.aggregations.AggregationBuilderbuildAggregation()Build aggregation that is necessary to create the according facets.org.elasticsearch.search.aggregations.AggregationBuilderbuildExcludeFilteredAggregation(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(Set<String> includeNames)Build aggregation that is necessary to create the facets specified by the includes list.Collection<Facet>createFacets(org.elasticsearch.search.aggregations.Aggregations aggResult, FilterContext filterContext, SearchQueryBuilder linkBuilder)create facets from aggregation result.Optional<Facet>mergeFacets(Facet first, Facet second)Try to merge facets with same label.
-
-
-
Constructor Detail
-
VariantFacetCreator
public VariantFacetCreator(Collection<FacetCreator> creators)
-
-
Method Detail
-
buildAggregation
public org.elasticsearch.search.aggregations.AggregationBuilder buildAggregation()
Description copied from interface:FacetCreatorBuild aggregation that is necessary to create the according facets.- Specified by:
buildAggregationin interfaceFacetCreator- Returns:
-
buildIncludeFilteredAggregation
public org.elasticsearch.search.aggregations.AggregationBuilder buildIncludeFilteredAggregation(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- Returns:
-
buildExcludeFilteredAggregation
public org.elasticsearch.search.aggregations.AggregationBuilder buildExcludeFilteredAggregation(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- Returns:
-
_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, SearchQueryBuilder linkBuilder)
Description copied from interface:FacetCreatorcreate facets from aggregation result.- Specified by:
createFacetsin interfaceFacetCreator- Returns:
-
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.- Specified by:
mergeFacetsin interfaceFacetCreator- Returns:
-
-