Hello,
I am unable to create an index using the following date format using the latest version of elasticsearch
PUT http://localhost:9200/demo HTTP/1.1
Accept: application/json
Content-Type: application/json
Content-Length: 151
Host: localhost:9200
{
"mappings": {
"properties": {
"date": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss aa"
}
}
}
}
Below is the error returned
HTTP/1.1 400 Bad Request
content-type: application/json; charset=UTF-8
content-length: 555
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: Invalid format: [yyyy-MM-dd HH:mm:ss aa]: Too many pattern letters: a"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: Invalid format: [yyyy-MM-dd HH:mm:ss aa]: Too many pattern letters: a","caused_by":{"type":"illegal_argument_exception","reason":"Invalid format: [yyyy-MM-dd HH:mm:ss aa]: Too many pattern letters: a","caused_by":{"type":"illegal_argument_exception","reason":"Too many pattern letters: a"}}},"status":400}
A sample value for the above format would be
11/16/2018 7:18:00 PM
The same format worked fine on v6.x, is this some bug in the latest version or is there a different format / syntax we need to switch onto.
Thanks,
Vikas.