IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Boxplot Aggregation Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Boxplot Aggregation Usage
editA boxplot metrics aggregation that computes boxplot of numeric values extracted from the aggregated documents. These values can be generated by a provided script or extracted from specific numeric or histogram fields in the documents.
boxplot aggregation returns essential information for making a box plot: minimum, maximum median, first quartile (25th percentile) and third quartile (75th percentile) values.
Be sure to read the Elasticsearch documentation on Boxplot Aggregation
Fluent DSL example
edita => a .Boxplot("boxplot_commits", plot => plot .Meta(m => m .Add("foo", "bar") ) .Field(p => p.NumberOfCommits) .Missing(10) .Compression(100) )
Object Initializer syntax example
editnew BoxplotAggregation("boxplot_commits", Field<Project>(p => p.NumberOfCommits)) { Meta = new Dictionary<string, object> { { "foo", "bar" } }, Missing = 10, Compression = 100 }
Example json output.
{ "boxplot_commits": { "meta": { "foo": "bar" }, "boxplot": { "field": "numberOfCommits", "missing": 10.0, "compression": 100.0 } } }
Handling Responses
editresponse.ShouldBeValid(); var boxplot = response.Aggregations.Boxplot("boxplot_commits"); boxplot.Should().NotBeNull(); boxplot.Min.Should().BeGreaterOrEqualTo(0); boxplot.Max.Should().BeGreaterOrEqualTo(0); boxplot.Q1.Should().BeGreaterOrEqualTo(0); boxplot.Q2.Should().BeGreaterOrEqualTo(0); boxplot.Q3.Should().BeGreaterOrEqualTo(0); boxplot.Lower.Should().BeGreaterOrEqualTo(0); boxplot.Upper.Should().BeGreaterOrEqualTo(0); boxplot.Meta.Should().NotBeNull().And.HaveCount(1); boxplot.Meta["foo"].Should().Be("bar");