Metric, Top N, Guage, and Markdown only show values for the last bucket in the date histogram. In your example, the last bucket has a value of zero. There is a lot of user confusion about where the values for Metric are getting pulled from. There is an open Pull Request that adds a new setting that controls the time range used for matching documents.
If you want to display the average filter ratio for the entire timerange, you will have to use a parent aggregation to keep a moving average. Then the last bucket will contain the metric that you are expecting.
Thank you for your answer. I figured out something like that but used the last « average » in the list. What is the difference with the moving average ?
Bucket aggregations divide documents in buckets.
Metric aggregations calculate a value for all of the documents in a single bucket
Pipeline aggregations work on the outputs produced from other aggregations rather than raw documents.
average. Metric aggregation that computes the average for all documents in a single bucket.
Moving average pipeline aggregation that computes the moving average of the output of another Metric aggregation .
average bucket A sibling pipeline aggregation which calculates the (mean) average value of a specified metric in a sibling aggregation
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.