Trying to create a new template

Hi guys,

I'm trying to create a new template. This template is a "default", and all indices must be create with this template.
I use Dev Tools on Kibana to create it.

PUT _template/template_default { "template" : "template_default", "template_default": { "order": 0, "template": "*", "settings": { "index": { "number_of_shards": "2", "number_of_replicas": "1" } } } }

It returns
{
"acknowledged": true
}

So i think it's actually good, but when i list my template, i have this return:

{
"template_default": {
"order": 0,
"template": "template_default",
"settings": {},
"mappings": {},
"aliases": {}
}
}

In fact, i can't change fields.
I don't know why.

If you had any idea...
Regards.

Hi,

I have to assume your using ES<6.

Your json schema for an index template is wrong. For example in 5.6 its documented here https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-templates.html

In addition to bad hierarchy/schema for an index template, you're quoting integers in there, you should also fix that.

Thx a lot for your answer.
I think it's actually ok for this correction, when i try a GET, i've a return with my conf:
GET _template/default

{
"default": {
"order": 0,
"template": "*",
"settings": {
"index": {
"number_of_shards": "2",
"number_of_replicas": "1"
}
},
"mappings": {},
"aliases": {}
}
}

Can i see if my template actually works on all cluster?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.