I am using the following date format below but my elastic search version complains that it cannot parse the date. Below you will find an example mapping. This is a spring-boot application.
Elasticsearch Version of spring-app: 6.7.0
Elasticsearch Version running on docker container 6.3.2
I am using the following pattern on the theDate
field.
yyyy-MM-dd'T'HH:mm:ss.SSSX
Example Mapping:
"theDate": {
"type": "date",
"format": "yyyy-MM-dd'''T'''HH:mm:SSSX"
}
Exception
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse [theDate]"}],"type":"mapper_parsing_exception","reason":"failed to parse [dateCreated]","caused_by":{"type":"illegal_argument_exception","reason":"Invalid format: \"1999-06-03T18:12:04.650Z\" is malformed at \"T18:12:04.650Z\""}},"status":400}