"template is missing" help please


(David Howell) #1

For this seemingly simple template file:
{
"test": {
"template": "test",
"order" : 1
}
}

When I POST to .../_template/test i get the following error:
{
"error": {
"root_cause": [
{
"type": "action_request_validation_exception",
"reason": "Validation Failed: 1: template is missing;"
}
],
"type": "action_request_validation_exception",
"reason": "Validation Failed: 1: template is missing;"
},
"status": 400
}

Been trying to two hours and can't seem to figure out why????? If you can help... thanks.....

Here is my ES "About" stuff:

{
"name": "Tempo",
"cluster_name": "elasticsearch",
"version": {
"number": "2.4.0",
"build_hash": "ce9f0c7394dee074091dd1bc4e9469251181fc55",
"build_timestamp": "2016-08-29T09:14:17Z",
"build_snapshot": false,
"lucene_version": "5.5.2"
},
"tagline": "You Know, for Search"
}


(Kimbro Staken) #2

You have "test": {} around the template which I don't think is valid.


(David Pilato) #3

Use PUT.

See https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-templates.html


(David Howell) #4

Removing "test": { did the trick. I guess I got confused with some other set of documentation, which i regularly use to do these kinds of tests.

Thanks to you both.


(system) #5