Query_string with datetime

We recently migrated to ES 7.1 from 5.8. In the previous version query_string with a datetime used to work.

Query with date and time

{
  "query": {
    "query_string": {
      "query": "data.lastUpdateTime:[* TO 2018-11-20T04:59:59Z]"
    }
  }
}

Output : 0 results

Query without time

{
  "query": {
    "query_string": {
      "query": "data.lastUpdateTime:[* TO 2018-11-20]"
    }
  }
}

Output: results returned as expected but we need to filter them by time

We do support multiple date formats for this field. Here is the mapping for this field:

"lastUpdateTime": {
                            "type": "date",
                            "format": "EEE MMM dd HH:mm:ss zzz yyyy||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd||yyyy-MM-dd'T'HH:mm:ssZ||epoch_millis||yyyy-MM-dd'T'HH:mm:ssX||yyyy-MM-dd'T'HH:mm:ssXX||yyyy-MM-dd'T'HH:mm:ssXXX||EEE MMM dd HH:mm:ss zzz yy||EEE MMM dd HH:mm:ss zzz yy"
                        }

Can you please advise on how to use query_string with datetime?

{{Preet}}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.