Skip to content
This repository has been archived by the owner on Jun 30, 2018. It is now read-only.

can't customize date type format when mapping types #922

Open
meejoe opened this issue Dec 19, 2013 · 3 comments
Open

can't customize date type format when mapping types #922

meejoe opened this issue Dec 19, 2013 · 3 comments
Labels

Comments

@meejoe
Copy link

meejoe commented Dec 19, 2013

my mapping code:

indexes "createdAt" , "type" => "date" , "index" => "no",'format' => "yyyy-MM-dd HH:mm:ss"

but actually the date type is stored with the default format:
format: dateOptionalTime
2012-03-13T11:22:42+08:00

@vamsi-krishna-E0029
Copy link

@meejoe Did you try deleting and creating the index again after changing the mapping? If the mapping changes, the index has to be created again for the new changes to take effect.

Moreover you are using the default dateOptionalTime format itself :).

Please check the below links for reference.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-date-format.html
http://joda-time.sourceforge.net/api-release/org/joda/time/format/ISODateTimeFormat.html#dateOptionalTimeParser
http://joda-time.sourceforge.net/api-release/src-html/org/joda/time/format/ISODateTimeFormat.html

@meejoe
Copy link
Author

meejoe commented Dec 19, 2013

@ovamsikrishna I'm afraid I didn't express the problem clearly.
The format property in the mapping, 'format' => "yyyy-MM-dd HH:mm:ss", doesn't work.

@karmi
Copy link
Owner

karmi commented Jan 15, 2014

@meejoe So, when you re-create the index with this mapping definition, you see dateOptionalTime when you query "myindex/_mapping"?

Can you turn on logging with Tire.configure { logger STDERR, level: "debug" } to see what is being sent to Elasticsearch?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants