WARNING: Version 2.1 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
date_histogram aggregations now have a default
0 instead of
time_zone parameter in queries or aggregations on fields of
date must now be either an ISO 8601 UTC offset, or a timezone id. For
example, the value
+1:00 must now be written as
histogram and the
date_histogram aggregation now support a simplified
offset option that replaces the previous
rounding options. Instead of having to specify two separate offset shifts of
the underlying buckets, the
offset option moves the bucket boundaries in
positive or negative direction depending on its argument.
date_histogram options for
post_zone are replaced by
time_zone option. The behavior of
time_zone is equivalent to the
pre_zone option. Setting
time_zone to a value like "+01:00" now
will lead to the bucket calculations being applied in the specified time zone.
key is returned as the timestamp in UTC, but the
returned in the time zone specified.
In addition to this, the
pre_zone_adjust_large_interval is removed because
we now always return dates and bucket keys in UTC.
exclude filtering on the
terms aggregation now uses the same
syntax as regexp queries instead of the Java regular
expression syntax. While simple regexps should still work, more complex ones
might need some rewriting. Also, the
flags parameter is no longer supported.
boolean fields will now return
1 as keys, and
"false" as string keys. See Boolean fields for more
date_histogram aggregation now returns a
Histogram object in the
response, and the
DateHistogram class has been removed. Similarly the
geo_distance aggregations all return a
Range object in the response, and the
GeoDistance classes have been removed.
The motivation for this is to have a single response API for the Range and
Histogram aggregations regardless of the type of data being queried. To
support this some changes were made in the
which applies to all bucket aggregations:
getKey()method now returns
String. The actual object type returned depends on the type of aggregation requested (e.g. the
date_histogramwill return a
DateTimeobject for this method whereas a
histogramwill return a
getKeyAsString()method has been added to return the String representation of the key.
getKeyAsX()methods have been removed.
getBucketAsKey(String)methods have been removed on all aggregations except the