Example #1
0
 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)));
     }
 }
Example #2
0
 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)
         });
     }
 }