The records which are saved in ES have a field called updated_at which stores time in epoch. In my search query I'm filtering date based on 'yyyy-mm-dd' format as follows:
{
"query": {
"bool": {
"must": [
{
"nested": {
"query": {
"bool": {
"filter": [
{
"range": {
"segment_status.updated_at": {
"from": "2022-05-16",
"to": "2022-05-16",
"include_lower": true,
"include_upper": true,
"boost": 1
}
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"path": "segment_status",
"ignore_unmapped": false,
"score_mode": "avg",
"boost": 1
}
}
]
}
}
}
My time zone is GMT+05:30. I have a record saved with epoch time 1652733000 which comes out to be 17th May at around 2:00 am. Using the above ES query I'm hitting this record and I'm assuming that is because the time at GMT is 16th May.
Please validate this and it would be helpful if there is a walkaround to fix this in the code generating the query.