Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document date aggregation limitation on arbitrary time intervals #23294

Closed
ppf2 opened this issue Feb 21, 2017 · 1 comment
Closed

Document date aggregation limitation on arbitrary time intervals #23294

ppf2 opened this issue Feb 21, 2017 · 1 comment
Labels
:Analytics/Aggregations Aggregations >docs General docs changes good first issue low hanging fruit help wanted adoptme

Comments

@ppf2
Copy link
Member

ppf2 commented Feb 21, 2017

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+).

  1. 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).

  1. 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.

@ppf2 ppf2 added :Analytics/Aggregations Aggregations >docs General docs changes labels Feb 21, 2017
@javanna javanna added the help wanted adoptme label May 15, 2017
@polyfractal
Copy link
Contributor

@elastic/es-search-aggs

@polyfractal polyfractal added the good first issue low hanging fruit label Mar 22, 2018
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this issue Apr 26, 2018
Adding some allowed abbreviated values for intervals in date histograms
as well as documenting the limitations of intervals larger than days.

Closes elastic#23294
cbuescher pushed a commit that referenced this issue Apr 26, 2018
Adding some allowed abbreviated values for intervals in date histograms
as well as documenting the limitations of intervals larger than days.

Closes #23294
cbuescher pushed a commit that referenced this issue Apr 26, 2018
Adding some allowed abbreviated values for intervals in date histograms
as well as documenting the limitations of intervals larger than days.

Closes #23294
cbuescher pushed a commit that referenced this issue Apr 26, 2018
Adding some allowed abbreviated values for intervals in date histograms
as well as documenting the limitations of intervals larger than days.

Closes #23294
cbuescher pushed a commit that referenced this issue Apr 26, 2018
Adding some allowed abbreviated values for intervals in date histograms
as well as documenting the limitations of intervals larger than days.

Closes #23294
cbuescher pushed a commit that referenced this issue Apr 26, 2018
Adding some allowed abbreviated values for intervals in date histograms
as well as documenting the limitations of intervals larger than days.

Closes #23294
cbuescher pushed a commit that referenced this issue Apr 26, 2018
Adding some allowed abbreviated values for intervals in date histograms
as well as documenting the limitations of intervals larger than days.

Closes #23294
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations >docs General docs changes good first issue low hanging fruit help wanted adoptme
Projects
None yet
Development

No branches or pull requests

3 participants