# Index template files are not working

**URL:** <https://discuss.elastic.co/t/index-template-files-are-not-working/36475>\
**Category:** Elasticsearch\
**Created:** [December 6, 2015, 4:39pm UTC](https://discuss.elastic.co/t/index-template-files-are-not-working/36475 "2015-12-06T16:39:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shay\_Tsadok](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shay_tsadok/32/6444_2.png) [@Shay\_Tsadok](https://discuss.elastic.co/u/Shay_Tsadok)\
**Post date:** [December 6, 2015, 4:39pm UTC](https://discuss.elastic.co/t/index-template-files-are-not-working/36475/1 "2015-12-06T16:39:55Z")

</div>

Hi,

When POSTing my template json to: [http://es:9200/\_template/gaia\_template](http://es:9200/_template/gaia_template) everything works just fine, but when I place it under ES\_HOME/config/templates/gaia\_template.json, nothing happens.  
I've tried to look inside ES server logs in debug mode but could not find any suspicious thing.  
I'm using ES 2.1.0

This is the json I'm using:

```auto
{
  "template": "gaia_*",
  "mappings": {
    "_default_": {
      "dynamic_templates": [
        {
          "strings": {
            "match_mapping_type": "string",
            "mapping": {
              "type": "string",
              "index": "not_analyzed"
            }
          }
        },
        {
          "timestamp_field": {
            "match": "timestamp",
            "mapping": {
              "type": "date"
            }
          }
        }
      ]
    }
  }
}

```

Any comment will be appreciated.

Thanks!  
Shay

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 6, 2015, 4:47pm UTC](https://discuss.elastic.co/t/index-template-files-are-not-working/36475/2 "2015-12-06T16:47:17Z")

</div>

From Elasticsearch version 2.0, [mappings in config files are no longer supported](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_20_mapping_changes.html#_mappings_in_config_files_not_supported), so what you are seeing is expected.

---

<div class="post-metadata">

**Author:** ![Shay\_Tsadok](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shay_tsadok/32/6444_2.png) [@Shay\_Tsadok](https://discuss.elastic.co/u/Shay_Tsadok)\
**Post date:** [December 7, 2015, 8:48am UTC](https://discuss.elastic.co/t/index-template-files-are-not-working/36475/3 "2015-12-07T08:48:28Z")

</div>

Thanks for the valuable information!  
Maybe you know to tell why this ability is not supported anymore?

To me having config file is better compare to work with the API, why:

1. Working with the API means that I need post-deployment process that will create the templates on the fly + a risk that a new index will be created without the template being applied yet.

2. We work with docker to deploy ES, hence having pre-configure image with the config file in it is better for us.

Thanks,  
Shay

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 7, 2015, 9:05am UTC](https://discuss.elastic.co/t/index-template-files-are-not-working/36475/4 "2015-12-07T09:05:24Z")

</div>

The issue on Github related to this change can be found [here](https://github.com/elastic/elasticsearch/issues/10620), although most of the discussion takes place at the corresponding [pull request](https://github.com/elastic/elasticsearch/pull/10870).

---

<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:33pm UTC](https://discuss.elastic.co/t/index-template-files-are-not-working/36475/5 "2017-07-05T23:33:05Z")

</div>


