|
@@ -1,7 +1,7 @@
|
|
|
[[search-aggregations-bucket-autodatehistogram-aggregation]]
|
|
|
=== Auto-interval Date Histogram Aggregation
|
|
|
|
|
|
-A multi-bucket aggregation similar to the <<search-aggregations-bucket-datehistogram-aggregation>> except
|
|
|
+A multi-bucket aggregation similar to the <<search-aggregations-bucket-datehistogram-aggregation>> except
|
|
|
instead of providing an interval to use as the width of each bucket, a target number of buckets is provided
|
|
|
indicating the number of buckets needed and the interval of the buckets is automatically chosen to best achieve
|
|
|
that target. The number of buckets returned will always be less than or equal to this target number.
|
|
@@ -89,8 +89,8 @@ Response:
|
|
|
|
|
|
==== Intervals
|
|
|
|
|
|
-The interval of the returned buckets is selected based on the data collected by the
|
|
|
-aggregation so that the number of buckets returned is less than or equal to the number
|
|
|
+The interval of the returned buckets is selected based on the data collected by the
|
|
|
+aggregation so that the number of buckets returned is less than or equal to the number
|
|
|
requested. The possible intervals returned are:
|
|
|
|
|
|
[horizontal]
|
|
@@ -101,8 +101,8 @@ days:: In multiples of 1, and 7
|
|
|
months:: In multiples of 1, and 3
|
|
|
years:: In multiples of 1, 5, 10, 20, 50 and 100
|
|
|
|
|
|
-In the worst case, where the number of daily buckets are too many for the requested
|
|
|
-number of buckets, the number of buckets returned will be 1/7th of the number of
|
|
|
+In the worst case, where the number of daily buckets are too many for the requested
|
|
|
+number of buckets, the number of buckets returned will be 1/7th of the number of
|
|
|
buckets requested.
|
|
|
|
|
|
==== Time Zone
|
|
@@ -147,7 +147,7 @@ GET my_index/_search?size=0
|
|
|
}
|
|
|
---------------------------------
|
|
|
|
|
|
-UTC is used if no time zone is specified, three 1-hour buckets are returned
|
|
|
+UTC is used if no time zone is specified, three 1-hour buckets are returned
|
|
|
starting at midnight UTC on 1 October 2015:
|
|
|
|
|
|
[source,console-result]
|
|
@@ -201,8 +201,8 @@ GET my_index/_search?size=0
|
|
|
// TEST[continued]
|
|
|
|
|
|
|
|
|
-Now three 1-hour buckets are still returned but the first bucket starts at
|
|
|
-11:00pm on 30 September 2015 since that is the local time for the bucket in
|
|
|
+Now three 1-hour buckets are still returned but the first bucket starts at
|
|
|
+11:00pm on 30 September 2015 since that is the local time for the bucket in
|
|
|
the specified time zone.
|
|
|
|
|
|
[source,console-result]
|
|
@@ -242,17 +242,17 @@ WARNING: When using time zones that follow DST (daylight savings time) changes,
|
|
|
buckets close to the moment when those changes happen can have slightly different
|
|
|
sizes than neighbouring buckets.
|
|
|
For example, consider a DST start in the `CET` time zone: on 27 March 2016 at 2am,
|
|
|
-clocks were turned forward 1 hour to 3am local time. If the result of the aggregation
|
|
|
-was daily buckets, the bucket covering that day will only hold data for 23 hours
|
|
|
-instead of the usual 24 hours for other buckets. The same is true for shorter intervals
|
|
|
-like e.g. 12h. Here, we will have only a 11h bucket on the morning of 27 March when the
|
|
|
+clocks were turned forward 1 hour to 3am local time. If the result of the aggregation
|
|
|
+was daily buckets, the bucket covering that day will only hold data for 23 hours
|
|
|
+instead of the usual 24 hours for other buckets. The same is true for shorter intervals
|
|
|
+like e.g. 12h. Here, we will have only a 11h bucket on the morning of 27 March when the
|
|
|
DST shift happens.
|
|
|
|
|
|
==== Scripts
|
|
|
|
|
|
-Like with the normal <<search-aggregations-bucket-datehistogram-aggregation, `date_histogram`>>, both document level
|
|
|
-scripts and value level scripts are supported. This aggregation does not however, support the `min_doc_count`,
|
|
|
-`extended_bounds` and `order` parameters.
|
|
|
+Like with the normal <<search-aggregations-bucket-datehistogram-aggregation, `date_histogram`>>, both document level
|
|
|
+scripts and value level scripts are supported. This aggregation does not however, support the `min_doc_count`,
|
|
|
+`extended_bounds`, `hard_bounds` and `order` parameters.
|
|
|
|
|
|
==== Minimum Interval parameter
|
|
|
|