-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Closed
Labels
:Analytics/AggregationsAggregationsAggregations>docsGeneral docs changesGeneral docs changesgood first issuelow hanging fruitlow hanging fruithelp wantedadoptmeadoptme
Description
As part of #19649 and #8939, it is revealed that date histogram does not support arbitrary time intervals, eg. 2M (for 2 months), etc.. for larger time spans like months, years, and weeks (on 5.0+).
- Our documentation today (https://www.elastic.co/guide/en/elasticsearch/reference/master/search-aggregations-bucket-datehistogram-aggregation.html) is not clear on this limitation today. It suggests that only fractional units are not supported.
Available expressions for interval: year, quarter, month, week, day, hour, minute, second
Time values can also be specified via abbreviations supported by time units parsing. Note that fractional time values are not supported, but you can address this by shifting to another time unit (e.g., 1.5h could instead be specified as 90m).
- From the discussion in date_histogram fails for year buckets >1, like "10y" #8939, it sounds like weeks is supported for arbitrary units (and it does work on pre-5.0 versions from testing 2.3, etc..). But on 5.0+, it now throws:
{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "failed to parse setting [DateHistogramAggregationBuilder.interval] with value [2w] as a time value: unit is missing or unrecognized"
}
],
This is an intended change as well per Colin, so let's document that all interval types with time spans (week, month, year) longer than days do not support arbitrary intervals.
arandall72
Metadata
Metadata
Assignees
Labels
:Analytics/AggregationsAggregationsAggregations>docsGeneral docs changesGeneral docs changesgood first issuelow hanging fruitlow hanging fruithelp wantedadoptmeadoptme