For the same data with date format search works in Elasticsearch 6.x.But, it do not work on 7.x

Hi,

The search with timestamp is not working for the 12-hour date format on 7.X . Please help me understand or fix the issue posted below. Thank you for the help.

------- This is the date format we are using.

PUT test
{
"mappings" : {
"properties" : {
"ADDTSX" : {
"type" : "date",
"format" : "MM/dd/yyyy hh:mm:ss.SSSSSS a XXX"
},
"ADDTSZ" : {
"type" : "date",
"format" : "MM/dd/yyyy hh:mm:ss.SSSSSS a ZZZZZ"
}
}
}
}

We were able to ingest data into elasticsearch.

PUT test/_doc/1
{
"ADDTSX": "04/01/2019 10:44:29.364443 AM -04:00",
"ADDTSZ": "04/01/2019 10:44:29.364443 AM -04:00"
}

----- When I do a search using term or match for timestamp using below query

GET test/_search
{
"query": {
"term": {
"ADDTSX": {
"value": "04/01/2019 10:44:29.364443 AM -04:00"
}
}
}
}
GET test/_search
{
"query": {
"match": {
"ADDTSX": "04/01/2019 10:44:29.364443 AM -04:00"
}
}
}

------- I am seeing the error below.

{
"error" : {
"root_cause" : [
{
"type" : "parse_exception",
"reason" : "failed to parse date field [04/01/2019 10:44:29.364443 AM -04:00] with format [MM/dd/yyyy hh:mm:ss.SSSSSS a XXX]: [failed to parse date field [04/01/2019 10:44:29.364443 AM -04:00] with format [MM/dd/yyyy hh:mm:ss.SSSSSS a XXX]]"
}
],
"type" : "search_phase_execution_exception",
"reason" : "all shards failed",
"phase" : "query",
"grouped" : true,
"failed_shards" : [
{
"shard" : 0,
"index" : "om_temp",
"node" : "bFZ2beNLSt25xckNC7vb2Q",
"reason" : {
"type" : "query_shard_exception",
"reason" : "failed to create query: failed to parse date field [04/01/2019 10:44:29.364443 AM -04:00] with format [MM/dd/yyyy hh:mm:ss.SSSSSS a XXX]: [failed to parse date field [04/01/2019 10:44:29.364443 AM -04:00] with format [MM/dd/yyyy hh:mm:ss.SSSSSS a XXX]]",
"index_uuid" : "Ebrd7LKcTceOsZt_qCEK7Q",
"index" : "om_temp",
"caused_by" : {
"type" : "parse_exception",
"reason" : "failed to parse date field [04/01/2019 10:44:29.364443 AM -04:00] with format [MM/dd/yyyy hh:mm:ss.SSSSSS a XXX]: [failed to parse date field [04/01/2019 10:44:29.364443 AM -04:00] with format [MM/dd/yyyy hh:mm:ss.SSSSSS a XXX]]",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "failed to parse date field [04/01/2019 10:44:29.364443 AM -04:00] with format [MM/dd/yyyy hh:mm:ss.SSSSSS a XXX]",
"caused_by" : {
"type" : "date_time_parse_exception",
"reason" : "date_time_parse_exception: Text '04/01/2019 10:44:29.364443 AM -04:00' could not be parsed: Conflict found: HourOfDay 23 differs from HourOfDay 10 while resolving AmPmOfDay",
"caused_by" : {
"type" : "date_time_exception",
"reason" : "date_time_exception: Conflict found: HourOfDay 23 differs from HourOfDay 10 while resolving AmPmOfDay"
}
}
}
}
}
}
],

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