/// <summary> /// Retrieves the terms aggregation just by it's name /// </summary> public static IReadOnlyCollection <KeyedBucket <string> > GetGroupBy(this AggregationsHelper aggs, string aggName) { aggs.CheckForAggregationInResult(aggName); var itemsTerms = aggs.Terms(aggName); return(itemsTerms.Buckets); }
public static AggregationsHelper GetAggregationContainingResult <T>(this AggregationsHelper aggs, Expression <Func <T, object> > filterRule = null) { if (filterRule == null) { return(aggs); } var filterName = filterRule.GenerateFilterName(); aggs.CheckForAggregationInResult(filterName); return(aggs.Filter(filterName)); }