コード例 #1
0
ファイル: GroupBys.cs プロジェクト: forki/fluentnest
        /// <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);
        }
コード例 #2
0
        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));
        }