We are using the AWS Elasticsearch 7.1 and we see some date formats are not being supported. It used to work in 5.5 and its a issue with only 7.1.
Mapping :
"dynamic": "strict",
"dynamic_templates": [],
"properties": {
"_all": {
"type": "text"
},
"age": {
"type": "long"
},
"endDateTime": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ss.SSS'ZZ'||yyyy-MM-dd'T'HH:mm:ss.SSS||yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
},
"id": {
"type": "keyword",
"copy_to": [
"_all"
],
"ignore_above": 256
},
"name": {
"type": "keyword",
"fields": {
"default": {
"type": "text",
"analyzer": "standard"
},
"language": {
"type": "text",
"analyzer": "english"
}
},
"copy_to": [
"_all"
],
"ignore_above": 256
}
}
}
}
Query:
"from": 0,
"size": 10,
"query": {
"bool": {
"must": [
{
"constant_score": {
"filter": {
"range": {
"endDateTime": {
"from": "2020-07-08T23:48:21.530-07:00",
"to": null,
"include_lower": false,
"include_upper": true,
"boost": 1
}
}
},
"boost": 1
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
}
}
The error is :
"root_cause": [
{
"type": "parse_exception",
"reason": "failed to parse date field [2020-07-08T23:48:21.530-07:00] with format [yyyy-MM-dd'T'HH:mm:ss.SSS'ZZ'||yyyy-MM-dd'T'HH:mm:ss.SSSXXX]: [Text '2020-07-08T23:48:21.530-07:00' could not be parsed, unparsed text found at index 23]"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
Can anyone please help here?