Hi,
I've seen a lot of discussion of this in various old threads, and I've
spent about two hours going over the docs and code and brainstorming with
my colleagues, but for the life of me: I still can't make this work right.
Basically, we are doing date ranges with date histogram facets, and need to
support users in different timezones querying the same data set.
For each user, I want to show hourly, daily, weekly or monthly facets,
relative to their OWN timezone, starting at the range filter's lower bound.
The filter's boundaries are always exactly on an hour (in the user's time
zone), and for bucket sizes of daily or greater, the they'll will be at
00:00:00 (in the user's time zone).
So, I might come along and say "I want to see all data between 3 Jan and 8
Jan, by day" -- and if I'm in GMT it's easy:
{
"query": {
"filtered" : {
"query" : {
"match_all" : {}
},
"filter" : {
"range": {
"datetime": {
"gte": "2012-01-03T00:00:00Z",
"lt":"2012-01-07T00:00:00Z"
}
}
}
}
},
"facets": {
"histo" : {
"date_histogram" : {
"field" : "datetime",
"interval" : "1d"
}
}
}
}
This returns evenly-spaced days starting on Jan 3rd.
But, I am too dumb to make this work if the lower bound of the range filter
isn't on a midnight UTC moment. For example if it's midnight EST/05:00UTC.
Or for that matter, midnight British Summer Time. The server-side UTC
calculations always give us unexpected bucket boundaries.
We've been juggling very possible combination of pre_zone, post_zone,
pre_offset, post_offset etc., but just can't find a combination that will
give us regular hourly/weekly/daily/monthly intervals starting at a given
point in time like that.
Please help. I know it's possible but this stuff makes my head hurt.
Thanks
--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.