Strange time_zone behavior with date histogram facet


(Allan Caffee) #1

I'm a little confused by the behavior of a date_histogram. My
understanding from the documentation
(http://www.elasticsearch.org/guide/reference/api/search/facets/date-histogram-facet.html)
is that a when providing a "time_zone" in the facet ElasticSearch will
adjust the "time" returned for each bucket to be milliseconds from epoch in
the specified "time_zone" (defaulting to UTC). But when I test this out as
shown in this gist: https://gist.github.com/1510658 it doesn't seem to be
adjusting the returned "time"s at all.

Do I need to set up a mapping of some kind on the index to tell it that the
times are in UTC, or something?

Also is there a way to change the format of the returned "time"s to be an
ISO format date string?


(Shay Banon) #2

Heya, yea, something is strange. Trying to track it down with the date
library I use, can you open an issue so we won't loose track of this?

On Thu, Dec 22, 2011 at 5:35 PM, Allan Caffee allan.caffee@gmail.comwrote:

I'm a little confused by the behavior of a date_histogram. My
understanding from the documentation (
http://www.elasticsearch.org/guide/reference/api/search/facets/date-histogram-facet.html)
is that a when providing a "time_zone" in the facet ElasticSearch will
adjust the "time" returned for each bucket to be milliseconds from epoch in
the specified "time_zone" (defaulting to UTC). But when I test this out as
shown in this gist: https://gist.github.com/1510658 it doesn't seem to be
adjusting the returned "time"s at all.

Do I need to set up a mapping of some kind on the index to tell it that
the times are in UTC, or something?

Also is there a way to change the format of the returned "time"s to be an
ISO format date string?


(system) #3