I have a inserted a data in elastic search from my timezone(Asia/Kolkata; +05:30) and converted into UTC.please find the below table for reference.
Now I am trying to fetch the data by passing my timezone for which i have to view the inserted data in local time(09:30). But the data fetched is still in UTC even when the local timezone is passed.Can some one help me out with this?
just to fully understand this. you have inserted a document with a date like this
{
"timestamp" : "2019-11-08T12:34:56.789+5:30"
}
And now you would like to query it as such. Let's take this example
DELETE test
PUT test/_doc/1?refresh
{
"timestamp" : "2019-11-08T01:00:00.000+05:30"
}
GET test/_mapping/field/timestamp
# no match, in UTC
GET test/_search
{
"query": {
"range": {
"timestamp": {
"gte": "2019-11-08"
}
}
}
}
# match, in UTC
GET test/_search
{
"query": {
"range": {
"timestamp": {
"gte": "2019-11-07"
}
}
}
}
# match in local timezone
GET test/_search
{
"query": {
"range": {
"timestamp": {
"gte": "2019-11-08T01:00:00.000+05:30"
}
}
}
}
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.