I have an issue that requires timezone handling, meaning that I need to use
dates given by user (in a certain timezone) to search in ES.
All dates indexed to ES are UTC, and what I'm looking for is a way to tell
ES that query dates are in a certain timezone, which internally would do
the maths to turn them to UTC and give me back results in the user timezone.
On Tue, 2012-11-27 at 09:07 -0800, Vania S. wrote:
Hi all,
I have an issue that requires timezone handling, meaning that I need
to use dates given by user (in a certain timezone) to search in ES.
All dates indexed to ES are UTC, and what I'm looking for is a way to
tell ES that query dates are in a certain timezone, which internally
would do the maths to turn them to UTC and give me back results in the
user timezone.
What do you mean by "give me back results in the user timezone"?
You get back the original document (unless you're talking about facets).
But, you can do eg a range filter and include the timezone information
in the date:
I meant, "give me back results that match user timezone".
My dates are indexed in this format "yyyy-mm-dd hh:mm:ss" and that is also
the format user is expecting to insert in queries.
Thanks,
On Tuesday, November 27, 2012 5:22:35 PM UTC, Clinton Gormley wrote:
On Tue, 2012-11-27 at 09:07 -0800, Vania S. wrote:
Hi all,
I have an issue that requires timezone handling, meaning that I need
to use dates given by user (in a certain timezone) to search in ES.
All dates indexed to ES are UTC, and what I'm looking for is a way to
tell ES that query dates are in a certain timezone, which internally
would do the maths to turn them to UTC and give me back results in the
user timezone.
What do you mean by "give me back results in the user timezone"?
You get back the original document (unless you're talking about facets).
But, you can do eg a range filter and include the timezone information
in the date:
I meant, "give me back results that match user timezone".
My dates are indexed in this format "yyyy-mm-dd hh:mm:ss" and that is
also the format user is expecting to insert in queries.
As I said, you get back exactly what you put in, so no - you would have
to handle that conversion in your application
clint
Thanks,
On Tuesday, November 27, 2012 5:22:35 PM UTC, Clinton Gormley wrote:
On Tue, 2012-11-27 at 09:07 -0800, Vania S. wrote:
> Hi all,
>
>
> I have an issue that requires timezone handling, meaning
that I need
> to use dates given by user (in a certain timezone) to search
in ES.
> All dates indexed to ES are UTC, and what I'm looking for is
a way to
> tell ES that query dates are in a certain timezone, which
internally
> would do the maths to turn them to UTC and give me back
results in the
> user timezone.
What do you mean by "give me back results in the user
timezone"?
You get back the original document (unless you're talking
about facets).
But, you can do eg a range filter and include the timezone
information
in the date:
{ range: { my_date: { gte: "2012-01-01T09:00:00+03:00" }}}
clint
On Tuesday, November 27, 2012 5:07:43 PM UTC, Vania S. wrote:
Hi all,
I have an issue that requires timezone handling, meaning that I need to
use dates given by user (in a certain timezone) to search in ES.
All dates indexed to ES are UTC, and what I'm looking for is a way to tell
ES that query dates are in a certain timezone, which internally would do
the maths to turn them to UTC and give me back results in the user timezone.
On Tuesday, November 27, 2012 5:30:40 PM UTC, Vania S. wrote:
Thanks clint!
On Tuesday, November 27, 2012 5:07:43 PM UTC, Vania S. wrote:
Hi all,
I have an issue that requires timezone handling, meaning that I need to
use dates given by user (in a certain timezone) to search in ES.
All dates indexed to ES are UTC, and what I'm looking for is a way to
tell ES that query dates are in a certain timezone, which internally would
do the maths to turn them to UTC and give me back results in the user
timezone.
On Tuesday, November 27, 2012 5:30:40 PM UTC, Vania S. wrote:
Thanks clint!
On Tuesday, November 27, 2012 5:07:43 PM UTC, Vania S. wrote:
Hi all,
I have an issue that requires timezone handling,
meaning that I need to use dates given by user (in a
certain timezone) to search in ES.
All dates indexed to ES are UTC, and what I'm looking
for is a way to tell ES that query dates are in a
certain timezone, which internally would do the maths
to turn them to UTC and give me back results in the
user timezone.
Is this possible?
Thanks!
True, but this way I don't have to change my indexed date formats... I can
still have "yyyy-mm-dd hh:mm:ss" and just add the "timezone" as ||+/+TZh,
right?
On Tuesday, November 27, 2012 5:30:40 PM UTC, Vania S. wrote:
Thanks clint!
On Tuesday, November 27, 2012 5:07:43 PM UTC, Vania S. wrote:
Hi all,
I have an issue that requires timezone handling,
meaning that I need to use dates given by user (in a
certain timezone) to search in ES.
All dates indexed to ES are UTC, and what I'm looking
for is a way to tell ES that query dates are in a
certain timezone, which internally would do the maths
to turn them to UTC and give me back results in the
user timezone.
Is this possible?
Thanks!
On Tue, 2012-11-27 at 18:24 +0000, Vânia Santos wrote:
True, but this way I don't have to change my indexed date formats... I
can still have "yyyy-mm-dd hh:mm:ss" and just add the "timezone" as ||
+/+TZh, right?
Yes, but I never suggested that you did need to change your indexed date
formats
On Tue, 2012-11-27 at 18:24 +0000, Vânia Santos wrote:
True, but this way I don't have to change my indexed date formats... I
can still have "yyyy-mm-dd hh:mm:ss" and just add the "timezone" as ||
+/+TZh, right?
Yes, but I never suggested that you did need to change your indexed date
formats
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.