# Index Templates - Differences between \_template & \_index\_template

**URL:** <https://discuss.elastic.co/t/index-templates-differences-between-template-index-template/255367>\
**Category:** Elasticsearch\
**Created:** [November 13, 2020, 5:41pm UTC](https://discuss.elastic.co/t/index-templates-differences-between-template-index-template/255367 "2020-11-13T17:41:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eduardo\_Iglesias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eduardo_iglesias/32/78395_2.png) [@Eduardo\_Iglesias](https://discuss.elastic.co/u/Eduardo_Iglesias)\
**Post date:** [November 13, 2020, 5:41pm UTC](https://discuss.elastic.co/t/index-templates-differences-between-template-index-template/255367/1 "2020-11-13T17:41:17Z")

</div>

Hello everyone,

Need help to identify the differences between the subject mentioned endpoints usage.

**\_index\_template endpoint**

```
 POST _index_template/index-template-1
{
  "index_patterns": ["logs-2019*"],
  "template": {
    "mappings": {"properties":
    {
    "v1":{"type":"short"},
    "timestamp": {"type": "date","format": "strict_date"}}}
 }
}

```

**\_template endpoint**

```
POST _template/i_master_template2
{
 "index_patterns":["logs-2020*"],
  "mappings": {"properties":
    {
    "v1":{"type":"short"},
    "timestamp": {"type": "date","format": "strict_date"}}}
  }
}   

```

Though the previous request were successful, when running **GET \_index\_template** it only returns one of the recently created index templates.

```
{
  "index_templates" : [
    {
      "name" : "index-template-1",
  "index_template" : {
    "index_patterns" : [
      "logs-2019*"
    ],
    "template" : {
      "mappings" : {
        "properties" : {
          "v1" : {
            "type" : "short"
          },
          "timestamp" : {
            "format" : "strict_date",
            "type" : "date"
          }
        }
      }
    },
    "composed_of" : []
}
]
}
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 13, 2020, 5:55pm UTC](https://discuss.elastic.co/t/index-templates-differences-between-template-index-template/255367/2 "2020-11-13T17:55:22Z")

</div>

The `_template` is legacy. See

> **[Get index template API | Elasticsearch Guide \[7.10\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/indices-get-template-v1.html)**

> This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8. For information about composable templates, [Index templates](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/indices-templates.html).

---

<div class="post-metadata">

**Author:** ![Eduardo\_Iglesias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eduardo_iglesias/32/78395_2.png) [@Eduardo\_Iglesias](https://discuss.elastic.co/u/Eduardo_Iglesias)\
**Post date:** [November 13, 2020, 8:09pm UTC](https://discuss.elastic.co/t/index-templates-differences-between-template-index-template/255367/3 "2020-11-13T20:09:24Z")

</div>

Thanks David!

---

<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:** [December 11, 2020, 8:09pm UTC](https://discuss.elastic.co/t/index-templates-differences-between-template-index-template/255367/4 "2020-12-11T20:09:25Z")

</div>

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