# Index template not updated

**URL:** <https://discuss.elastic.co/t/index-template-not-updated/181427>\
**Category:** Elasticsearch\
**Created:** [May 16, 2019, 2:23pm UTC](https://discuss.elastic.co/t/index-template-not-updated/181427 "2019-05-16T14:23:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [May 16, 2019, 2:23pm UTC](https://discuss.elastic.co/t/index-template-not-updated/181427/1 "2019-05-16T14:23:15Z")

</div>

HI all,

I have an index template which is defined to use only a single shard.

```
GET _template/plx

{
  "plx" : {
    "order" : 0,
    "index_patterns" : [
      "plx*"
    ],
    "settings" : {
      "index" : {
        "number_of_shards" : "1",
        "number_of_replicas" : "0"
      }
    },
    "mappings" : { },
    "aliases" : { }
  }
}

```

I want to increase the number of Shards to 2. As I understand when changing the template it will only affect new indexes, so when the index is rotated next time and a new one is created, correct? Currently I am rotating once a week via logstash index pattern. (I may change to rollover when I checked this feature out).

So I am now sending the following:

```
POST template/plx
{
 
    "index_patterns" : [
      "plx*"
    ],
    "settings" : {
      "index" : {
        "number_of_shards" : "2",
        "number_of_replicas" : "0"
      }
    },
    "mappings" : { },
    "aliases" : { }
  
}

```

getting following response:

```
{
  "_index" : "template",
  "_type" : "plx",
  "_id" : "byQBwWoBWG0LH47pl1tp",
  "_version" : 1,
  "result" : "created",
  "_shards" : {
    "total" : 2,
    "successful" : 1,
    "failed" : 0
  },
  "_seq_no" : 4,
  "_primary_term" : 1
}

```

But when I query the template again, I still shows the same as initial: 1 shard.

Can you point to my mistake?

Using elasticsearch 6.6.2.

Elasticsearch log is showing:

```
[2019-05-16T14:12:42,365][INFO][o.e.c.m.MetaDataMappingService] [0] [template/cYj_zxK0TPKGyAW5fzqC_A] update_mapping [plx]

```

Thanks a lot, Andreas

---

<div class="post-metadata">

**Author:** ![whatgeorgemade](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/whatgeorgemade/32/103246_2.png) [@whatgeorgemade](https://discuss.elastic.co/u/whatgeorgemade)\
**Post date:** [May 16, 2019, 3:39pm UTC](https://discuss.elastic.co/t/index-template-not-updated/181427/2 "2019-05-16T15:39:57Z")

</div>

There should be an `_` in your `POST` when you create the template. i.e. `POST _template/plx` instead of `POST template/plx`. At the moment, you're creating a document in a new index called `template`.

---

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [May 17, 2019, 6:39am UTC](https://discuss.elastic.co/t/index-template-not-updated/181427/3 "2019-05-17T06:39:22Z")

</div>

@whatgeorgemade

Thanks a lot. That's it 😉

---

<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:** [June 14, 2019, 6:39am UTC](https://discuss.elastic.co/t/index-template-not-updated/181427/4 "2019-06-14T06:39:23Z")

</div>

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