You are looking at documentation for an older release.
Not what you want? See the
current release documentation.
Extended Stats Aggregation Usageedit
Fluent DSL Exampleedit
s => s
.Aggregations(a => a
.ExtendedStats("commit_stats", es => es
.Field(p => p.NumberOfCommits)
)
)Object Initializer Syntax Exampleedit
new SearchRequest<Project>
{
Aggregations = new ExtendedStatsAggregation("commit_stats", Field<Project>(p => p.NumberOfCommits))
}Example json output.
{
"aggs": {
"commit_stats": {
"extended_stats": {
"field": "numberOfCommits"
}
}
}
}
Handling Responsesedit
response.ShouldBeValid();
var commitStats = response.Aggs.ExtendedStats("commit_stats");
commitStats.Should().NotBeNull();
commitStats.Average.Should().BeGreaterThan(0);
commitStats.Max.Should().BeGreaterThan(0);
commitStats.Min.Should().BeGreaterThan(0);
commitStats.Count.Should().BeGreaterThan(0);
commitStats.Sum.Should().BeGreaterThan(0);
commitStats.SumOfSquares.Should().BeGreaterThan(0);
commitStats.StdDeviation.Should().BeGreaterThan(0);
commitStats.StdDeviationBounds.Should().NotBeNull();
commitStats.StdDeviationBounds.Upper.Should().BeGreaterThan(0);
commitStats.StdDeviationBounds.Lower.Should().NotBe(0);