I'm trying to use the time zone option within a date histogram, since
the hour I get is greater than the hour saved in elastic (by 2 hours).
I'm using 0.18.7.
This is my query:
{"query":{"filtered":{"query":{"range":{"date":
{"from":"2011-12-18","to":"2011-12-18"}}},"filter":[{"terms":{"ctid":
["11"]}}]}},"facets":{"date_sum_stats":{"date_histogram":
{"key_field":"date","value_field":"sum","interval":"hour","time_zone":-2}}}}
1324188000000 epoch is "08" in hours (doing Time.at(1324188000000 /
1000).strftime("%H")) but the document is saved with the hour "06":
users
new_user
370563565
1
IE
US
11
2011-12-18T06:00:00+00:00
35
Any ideas?
I've tried also with 2 as time zone and with no time zone at all, but
always getting same (wrong) hours.
On Wednesday, February 15, 2012 at 2:02 PM, Yehuda Zargarov wrote:
Hi,
I'm trying to use the time zone option within a date histogram, since
the hour I get is greater than the hour saved in elastic (by 2 hours).
I'm using 0.18.7.
This is my query:
{"query":{"filtered":{"query":{"range":{"date":
{"from":"2011-12-18","to":"2011-12-18"}}},"filter":[{"terms":{"ctid":
["11"]}}]}},"facets":{"date_sum_stats":{"date_histogram":
{"key_field":"date","value_field":"sum","interval":"hour","time_zone":-2}}}}
1324188000000 epoch is "08" in hours (doing Time.at (http://Time.at)(1324188000000 /
1000).strftime("%H")) but the document is saved with the hour "06":
users
new_user
370563565
1
IE
US
11
2011-12-18T06:00:00+00:00
35
Any ideas?
I've tried also with 2 as time zone and with no time zone at all, but
always getting same (wrong) hours.
On Wednesday, February 15, 2012 at 2:02 PM, Yehuda Zargarov wrote:
Hi,
I'm trying to use the time zone option within a date histogram, since
the hour I get is greater than the hour saved in elastic (by 2 hours).
I'm using 0.18.7.
This is my query:
{"query":{"filtered":{"query":{"range":{"date":
{"from":"2011-12-18","to":"2011-12-18"}}},"filter":[{"terms":{"ctid":
["11"]}}]}},"facets":{"date_sum_stats":{"date_histogram":
{"key_field":"date","value_field":"sum","interval":"hour","time_zone":-2}}}}
1324188000000 epoch is "08" in hours (doing Time.at (http://Time.at)(1324188000000/
1000).strftime("%H")) but the document is saved with the hour "06":
users
new_user
370563565
1
IE
US
11
2011-12-18T06:00:00+00:00
35
Any ideas?
I've tried also with 2 as time zone and with no time zone at all, but
always getting same (wrong) hours.
On Wednesday, February 15, 2012 at 2:02 PM, Yehuda Zargarov wrote:
Hi,
I'm trying to use the time zone option within a date histogram, since
the hour I get is greater than the hour saved in elastic (by 2 hours).
I'm using 0.18.7.
This is my query:
{"query":{"filtered":{"query":{"range":{"date":
{"from":"2011-12-18","to":"2011-12-18"}}},"filter":[{"terms":{"ctid":
["11"]}}]}},"facets":{"date_sum_stats":{"date_histogram":
{"key_field":"date","value_field":"sum","interval":"hour","time_zone":-2}}}}
1324188000000 epoch is "08" in hours (doing Time.at (http://Time.at)(1324188000000/
1000).strftime("%H")) but the document is saved with the hour "06":
users
new_user
370563565
1
IE
US
11
2011-12-18T06:00:00+00:00
35
Any ideas?
I've tried also with 2 as time zone and with no time zone at all, but
always getting same (wrong) hours.
Note though, that the time_zone in 0.19 just sets the pre_zone, which basically applies the time zone before the rounding/bucketing, you might need to also pass post_zone to convert the bucket data to a time zone from UTC. See more here: Elasticsearch Platform — Find real-time answers at scale | Elastic.
On Thursday, February 16, 2012 at 9:31 PM, Shay Banon wrote:
On Wednesday, February 15, 2012 at 2:02 PM, Yehuda Zargarov wrote:
Hi,
I'm trying to use the time zone option within a date histogram, since
the hour I get is greater than the hour saved in elastic (by 2 hours).
I'm using 0.18.7.
This is my query:
{"query":{"filtered":{"query":{"range":{"date":
{"from":"2011-12-18","to":"2011-12-18"}}},"filter":[{"terms":{"ctid":
["11"]}}]}},"facets":{"date_sum_stats":{"date_histogram":
{"key_field":"date","value_field":"sum","interval":"hour","time_zone":-2}}}}
1324188000000 epoch is "08" in hours (doing Time.at (http://Time.at) (http://Time.at)(1324188000000/
1000).strftime("%H")) but the document is saved with the hour "06":
users
new_user
370563565
1
IE
US
11
2011-12-18T06:00:00+00:00
35
Any ideas?
I've tried also with 2 as time zone and with no time zone at all, but
always getting same (wrong) hours.
Note though, that the time_zone in 0.19 just sets the pre_zone, which basically applies the time zone before the rounding/bucketing, you might need to also pass post_zone to convert the bucket data to a time zone from UTC. See more here:Elasticsearch Platform — Find real-time answers at scale | Elastic....
On Thursday, February 16, 2012 at 9:31 PM, Shay Banon wrote:
Then gist a full recreation, I will have a look. (seehttp://www.elasticsearch.org/help).
On Thursday, February 16, 2012 at 5:03 PM, Yehuda Zargarov wrote:
Hi Shay,
Just installed elasticsearch-0.19.0.RC2, and still the "time_zone"
option on date histogram does not affect the result.
On Wednesday, February 15, 2012 at 2:02 PM, Yehuda Zargarov wrote:
Hi,
I'm trying to use the time zone option within a date histogram, since
the hour I get is greater than the hour saved in elastic (by 2 hours).
I'm using 0.18.7.
This is my query:
{"query":{"filtered":{"query":{"range":{"date":
{"from":"2011-12-18","to":"2011-12-18"}}},"filter":[{"terms":{"ctid":
["11"]}}]}},"facets":{"date_sum_stats":{"date_histogram":
{"key_field":"date","value_field":"sum","interval":"hour","time_zone":-2}}}}
1324188000000 epoch is "08" in hours (doing Time.at (http://Time.at) (http://Time.at)(1324188000000/
1000).strftime("%H")) but the document is saved with the hour "06":
users
new_user
370563565
1
IE
US
11
2011-12-18T06:00:00+00:00
35
Any ideas?
I've tried also with 2 as time zone and with no time zone at all, but
always getting same (wrong) hours.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.