-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
Spilt out from #28432.
This issue is also stalled until #27330 is complete.
Currently if multiple unit intervals (e.g. "2d" as opposed to "1d") are used in the date histogram aggregation we create fixed duration buckets instead of calendar interval buckets. For a 2d interval this means that the buckets represent 2 * 24 * 60 * 60 * 1000 = 172800000 milliseconds
instead of representing two days starting at midnight the first day and ending just before midnight the third day.
This is not a great API experience and it would be better for all intervals to be calendar intervals. We have tried this before using Joda time but it was not possible to implement. Very preliminary investigations into java.time seem to suggest there is more of a chance of getting this working so once the move to java.time is complete we should investigate making all intervals in the date_histogram calendar intervals.