Time zone for simple search


(Marcin Dojwa) #1

Hi,

Is it possible to use 'pre_zone' and 'post_zone' with simple search not
using date histogram ? For example, I would like to get converted to given
timezone date in result for:
{
"query":{
"term":{
"_all":"help"
}
}
}

Thanks for help.


(Shay Banon) #2

I don't see any date relevant info here in your query. Hits you get back
will have hte time you indexed it with, and for things like range queries,
you can specify the time zone in the string representation of the date.

On Tue, Mar 20, 2012 at 12:58 PM, Marcin Dojwa m.dojwa@livechatinc.comwrote:

Hi,

Is it possible to use 'pre_zone' and 'post_zone' with simple search not
using date histogram ? For example, I would like to get converted to given
timezone date in result for:
{
"query":{
"term":{
"_all":"help"
}
}
}

Thanks for help.


(Marcin Dojwa) #3

Thanks, I thought that there is a way that Elasticsearch could give me a
date in returned document converted to the requested timezone. But I can do
this on my side too so this is not that important. You mentioned about
specifying time zone in the string representation of date while sending
range queries, could you give me any example how to specify the timezone
this way ? Thanks

Best regards.
Marcin.

2012/3/20 Shay Banon kimchy@gmail.com

I don't see any date relevant info here in your query. Hits you get back
will have hte time you indexed it with, and for things like range queries,
you can specify the time zone in the string representation of the date.

On Tue, Mar 20, 2012 at 12:58 PM, Marcin Dojwa m.dojwa@livechatinc.comwrote:

Hi,

Is it possible to use 'pre_zone' and 'post_zone' with simple search not
using date histogram ? For example, I would like to get converted to given
timezone date in result for:
{
"query":{
"term":{
"_all":"help"
}
}
}

Thanks for help.


(Shay Banon) #4

By default, elasticsearch works with the ISO8601 date format (for date
types): http://en.wikipedia.org/wiki/ISO_8601.

On Tue, Mar 20, 2012 at 2:29 PM, Marcin Dojwa m.dojwa@livechatinc.comwrote:

Thanks, I thought that there is a way that Elasticsearch could give me a
date in returned document converted to the requested timezone. But I can do
this on my side too so this is not that important. You mentioned about
specifying time zone in the string representation of date while sending
range queries, could you give me any example how to specify the timezone
this way ? Thanks

Best regards.
Marcin.

2012/3/20 Shay Banon kimchy@gmail.com

I don't see any date relevant info here in your query. Hits you get back
will have hte time you indexed it with, and for things like range queries,
you can specify the time zone in the string representation of the date.

On Tue, Mar 20, 2012 at 12:58 PM, Marcin Dojwa m.dojwa@livechatinc.comwrote:

Hi,

Is it possible to use 'pre_zone' and 'post_zone' with simple search not
using date histogram ? For example, I would like to get converted to given
timezone date in result for:
{
"query":{
"term":{
"_all":"help"
}
}
}

Thanks for help.


(system) #5