You are looking at documentation for an older release.
Not what you want? See the
current release documentation.
Sum aggregationedit
A single-value metrics aggregation that sums up numeric values that are extracted from the aggregated documents.
Fluent DSLedit
var result = client.Search<ElasticsearchProject>(s => s .Aggregations(a => a .Sum("my_sum_agg", sa => sa .Field(p => p.Followers.First().Age) ) ) ); var agg = result.Aggs.Sum("my_sum_agg");
Object Initializer Syntaxedit
var request = new SearchRequest { Aggregations = new Dictionary<string, IAggregationContainer> { { "my_sum_agg", new AggregationContainer { Sum = new SumAggregator { Field = "followers.age" } } } } }; var result = client.Search<ElasticsearchProject>(request); var agg = result.Aggs.Sum("my_sum_agg");
Refer to the original docs for more information.