I have tested that the following query works in versions of ES 6 (6.2.3, 6.8.2), but fails in versions of 7 (7.1.1, 7.3.1).
The query is:
{
"query": {
"bool": {
"filter": [
{
"range": {
"runServiceTimeUTC": {
"gte": "12:50:00 PM",
"lte": "01:10:00 PM",
"format": "hh:mm:ss a"
}
}
}
]
}
}
}
The field is formatted as a date with format 'hh:mm:ss a':
"runServiceTimeUTC" : {
"type" : "date",
"format" : "hh:mm:ss a"
}
The resulting error in v7 (7.1.1, 7.3.1) is as follows:
{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "failed to parse date field [01:10:00 PM] with format [hh:mm:ss a]: [Text '01:10:00 PM' could not be parsed: Conflict found: HourOfDay 23 differs from HourOfDay 13 while resolving AmPmOfDay]"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "rundirections_43800dac-9f95-40f2-9414-3dc58ac3234a_1579189356676",
"node": "jI6lf6EFSimbcIRTzk2MAQ",
"reason": {
"type": "parse_exception",
"reason": "failed to parse date field [01:10:00 PM] with format [hh:mm:ss a]: [Text '01:10:00 PM' could not be parsed: Conflict found: HourOfDay 23 differs from HourOfDay 13 while resolving AmPmOfDay]",
"caused_by": {
"type": "date_time_parse_exception",
"reason": "Text '01:10:00 PM' could not be parsed: Conflict found: HourOfDay 23 differs from HourOfDay 13 while resolving AmPmOfDay",
"caused_by": {
"type": "date_time_exception",
"reason": "Conflict found: HourOfDay 23 differs from HourOfDay 13 while resolving AmPmOfDay"
}
}
}
}
]
},
"status": 400
}
If I change the range query to read as follows, the query suddenly works:
{
"range": {
"runServiceTimeUTC": {
"gte": "12:50:00 PM",
"lte": "13:10:00 PM",
"format": "HH:mm:ss a"
}
}
}
Any ideas what's going wrong here?