private static void NumericAggregations(AggregationDictionary aggregationDict, IEnumerable <string> propertyFieldNames) { foreach (var propertyFieldName in propertyFieldNames) { aggregationDict.Add(propertyFieldName + ".max", new MaxAggregation(propertyFieldName, string.Format("properties.{0}", propertyFieldName))); aggregationDict.Add(propertyFieldName + ".min", new MinAggregation(propertyFieldName, string.Format("properties.{0}", propertyFieldName))); aggregationDict.Add(propertyFieldName + ".avg", new AverageAggregation(propertyFieldName, string.Format("properties.{0}", propertyFieldName))); } }
private static void StringAggregations(AggregationDictionary aggregationDict, IEnumerable <string> propertyFieldNames) { foreach (var propertyFieldName in propertyFieldNames) { aggregationDict.Add(propertyFieldName, new TermsAggregation(propertyFieldName) { Field = string.Format("properties.{0}.keyword", propertyFieldName) }); } }