Dynamic_date_format for the whole cluster


(abxccd) #1

I would like to add a date format using dynamic_date_format. The
documentationhttp://www.elasticsearch.org/guide/reference/mapping/root-object-type.htmlshow how to do it for types, but is it possible to put this setting on the
cluster so that all nodes will honor this date format?

I tried PUTting the following to http://localhost:9200/_cluster and
http://localhost:9200/, but it does not seem to work:

{
"dynamic_date_formats": "yyyy-MM-dd HH:mm:ss"
}


(Shay Banon) #2

You can put a template that matches all indices, and in it have a mapping called default, where you configure the dynamic_date_formats. This means that for each index created the template will be matched, and the default type mapping will be applied to all types within that index.

On Aug 5, 2012, at 5:29 AM, abxccd abxccd@msn.com wrote:

I would like to add a date format using dynamic_date_format. The documentation show how to do it for types, but is it possible to put this setting on the cluster so that all nodes will honor this date format?

I tried PUTting the following to http://localhost:9200/_cluster and http://localhost:9200/, but it does not seem to work:

{
"dynamic_date_formats": "yyyy-MM-dd HH:mm:ss"
}


(abxccd) #3

Great idea! Thank you! :slight_smile:

On Wednesday, August 8, 2012 8:02:48 AM UTC+10, kimchy wrote:

You can put a template that matches all indices, and in it have a mapping
called default, where you configure the dynamic_date_formats. This means
that for each index created the template will be matched, and the default
type mapping will be applied to all types within that index.

On Aug 5, 2012, at 5:29 AM, abxccd <abx...@msn.com <javascript:>> wrote:

I would like to add a date format using dynamic_date_format. The
documentationhttp://www.elasticsearch.org/guide/reference/mapping/root-object-type.htmlshow how to do it for types, but is it possible to put this setting on the
cluster so that all nodes will honor this date format?

I tried PUTting the following to http://localhost:9200/_cluster and
http://localhost:9200/, but it does not seem to work:

{
"dynamic_date_formats": "yyyy-MM-dd HH:mm:ss"
}


(system) #4