elasticsearch/elasticsearch — Issue #1690: date_formats doesn't work
Author: Avatah
Created: 2012-02-10 13:13:09+00:00
State: open

Changing default date format by using date_formats in type mapping doesn't work.

curl -XPUT http://localhost:9200/i
curl -XPUT http://localhost:9200/i/t/_mapping -d '{ "t" : { "date_formats" : [ "basic_date_time" ]}}'
curl -XPUT http://localhost:9200/i/t/1 -d ' { "basic_date" : "20120209T180027.513+0100", "date_opt_time" : "2012-02-09T18:00:27.513+0100"} '
curl -XGET http://localhost:9200/i/t/_mapping

{"t":{"dynamic_date_formats":["basic_date_time"],"properties":{"basic_date":{"type":"string"},"date_opt_time":{"type":"string"}}}}

Field basic_date wasn't properly recognized as a date.

Related discussion:
https://groups.google.com/d/topic/elasticsearch/NeEtjBlOiPA/discussion