Trying to specify format (in index mapping) for the date field in ES 7.6. Any of these are not accepted:
"createdAt" : {
"type" : "date",
"format": "yyyy-MM-dd'''T'''HH:mm:ss.SSSZZ"
},
"createdAt" : {
"type" : "date",
"format": "yyyy-MM-dd'T'HH:mm:ss.SSSZZ"
},
Error is always the same:
"type" : "illegal_argument_exception", "reason" : "Invalid format: [yyyy-MM-ddTHH:mm:ss.SSSZZ]: Unknown pattern letter: T",
Here is full example to reproduce:
curl -X DELETE "localhost:9200/example?pretty"
curl -X PUT "localhost:9200/example/_mappings?pretty" -H 'Content-Type: application/json' -d' {
"dynamic": false,
"properties" : {
"name" : {
"type" : "text"
},
"createdAt" : {
"type" : "date",
"format" : "yyyyMMdd'T'HHmmss.SSSZ"
}
}
}'