How to change the default date format?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to change the default date format?

HubertChang
Now date format can be specified by mapping for specified type. Documents said "The parsing of dates uses Joda. The default date parsing used if no format is specified is ISODateTimeFormat.dateOptionalTimeParser.".

How to change the default date format globally, not type specified?
Reply | Threaded
Open this post in threaded view
|

Re: How to change the default date format?

kimchy
Administrator
If you refer to automatically identifying strings as dates, and which format to use, then, on a per type basis, you can use the dateFormats option, explained here: http://www.elasticsearch.com/docs/elasticsearch/mapping/object_type/#dateFormats. This, of course, can be applied on the root level object mapping (http://www.elasticsearch.com/docs/elasticsearch/mapping/root_object_type/).

If you want to change the format of dates for types that are automatically introduced, then you can change the dynamic mappings explained here: http://www.elasticsearch.com/docs/elasticsearch/mapping/dynamic_mapping/. I have just added this section to the mapping area (it used to be documented under the mapper module).

-shay.banon

On Fri, Apr 2, 2010 at 10:25 PM, HubertChang <[hidden email]> wrote:

Now date format can be specified by mapping for specified type. Documents
said "The parsing of dates uses Joda. The default date parsing used if no
format is specified is ISODateTimeFormat.dateOptionalTimeParser.".

How to change the default date format globally, not type specified?
--
View this message in context: http://n3.nabble.com/How-to-change-the-default-date-format-tp693607p693607.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: How to change the default date format?

HubertChang
It's dynamic mapping.

Thanks.