# Index template file is not applied

**URL:** <https://discuss.elastic.co/t/index-template-file-is-not-applied/34095>\
**Category:** Elasticsearch\
**Created:** [November 7, 2015, 11:22pm UTC](https://discuss.elastic.co/t/index-template-file-is-not-applied/34095 "2015-11-07T23:22:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![byku](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@byku](https://discuss.elastic.co/u/byku)\
**Post date:** [November 7, 2015, 11:22pm UTC](https://discuss.elastic.co/t/index-template-file-is-not-applied/34095/1 "2015-11-07T23:22:43Z")

</div>

Hi all,  
I configuring docker container with ES v2. I use next template:

```
{
  "template": "*",
  "order": 10,
  "settings": {},
  "mappings": {
    "_default_": {
      "dynamic_templates": [
        {
          "string_fields": {
            "match": "*",
            "match_mapping_type": "string",
            "mapping": {
              "index": "not_analyzed",
              "type": "string"
            }
          }
        }
      ]
    }
  }
}

```

If I put it via HTTP request - it works fine:

```
[2015-11-07 23:01:06,924][INFO][cluster.metadata] [elastic-node] [jpolli-events-2015-11-07] creating index, cause [auto(index api)], templates [template_1], shards [5]/[1], mappings [_default_, storage_client_delete]

```

but if I place it in config/template path it doesn't applied:

```
[2015-11-07 23:02:13,915][INFO][cluster.metadata] [elastic-node] [jpolli-events-2015-11-07] creating index, cause [auto(index api)], templates [], shards [5]/[1], mappings [http_response]

```

I have specified config path:

```
path.conf : "/usr/share/elasticsearch/config/"

```

and place template to /usr/share/elasticsearch/config/templates dir but it doesn't work. Order modification also doesn't help.

Any ideas what's wrong?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 8, 2015, 8:52pm UTC](https://discuss.elastic.co/t/index-template-file-is-not-applied/34095/2 "2015-11-08T20:52:09Z")

</div>

I believe 2.0 dropped support for having index templates in files. The [2.0 index template documentation](https://www.elastic.co/guide/en/elasticsearch/reference/2.0/indices-templates.html) no longer lists this option and the [2.0 breaking changes documentation](https://www.elastic.co/guide/en/elasticsearch/reference/2.0/breaking_20_mapping_changes.html) indicates the same thing (but is perhaps no 100% clear).

---

<div class="post-metadata">

**Author:** ![byku](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@byku](https://discuss.elastic.co/u/byku)\
**Post date:** [November 8, 2015, 9:10pm UTC](https://discuss.elastic.co/t/index-template-file-is-not-applied/34095/3 "2015-11-08T21:10:36Z")

</div>

Thanks Magnus,

Yes it's not clear from changelog but I'm afraid that it is the reason of issue. It raises another question of default configuration for docker but I'll create a separate topic

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:39pm UTC](https://discuss.elastic.co/t/index-template-file-is-not-applied/34095/4 "2017-07-05T23:39:55Z")

</div>


