Hi, I am currently facing a weird issue, when I am include timezone, the elastic search is returning zero hits:
{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
}
}
Whilst if i remove the timezone, it works:
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 3,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "business_logstash_wbsp",
"_type" : "_doc",
"_id" : "OEg573QBzOy_U32-2Hq1",
"_score" : 1.0,
"_source" : {
"wbsp" : "smit 12345 1005000000000002"
}
},
{
"_index" : "business_logstash_wbsp",
"_type" : "_doc",
"_id" : "E0g573QBzOy_U32-GHor",
"_score" : 1.0,
"_source" : {
"wbsp" : "smit 12345 1005000000000002"
}
},
{
"_index" : "business_logstash_wbsp",
"_type" : "_doc",
"_id" : "KUg573QBzOy_U32-iHoa",
"_score" : 1.0,
"_source" : {
"wbsp" : "smit 12345 1005000000000002"
}
}
]
}
}
Here is the sample query:
GET /business_logstash_wbsp/_search
{
"_source": "wbsp",
"query":{
"range":{
"@timestamp":{
"gte":"2020-10-01T00:01:00",
"lt":"2020-10-03T16:00:00"
}
}
}
}
Ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html