Date_histogram aggregation and DST

(dunaeth) #1


I wonder whether it was possible or not to have date histogram aggregation
be DST aware. From what I understand of the date histogram algorithm, it's
something like :

date + offset - (date + offset) % interval

Maybe a scripted term aggregation would be a better solution if the date
datas already have a DST aware offset registered.

For example, let's say we have documents with those kind of date fields :

2014-03-29T00:30:00.000+01:00 (2014-03-28T23:30:00.000Z)
2014-03-30T00:30:00.000+01:00 (2014-03-29T23:30:00.000Z)
2014-03-31T00:30:00.000+02:00 (2014-03-30T22:30:00.000Z)
2014-03-31T01:30:00.000+02:00 (2014-03-30T23:30:00.000Z)

Using string manipulation in scripted term aggregation to retrieve document
by day would be trivial but less performant than date_histogram aggregation
which would probably not be able to aggregate dates taking DST into account.

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit

(system) #2