# How to get the number of routing shards for an index

**URL:** <https://discuss.elastic.co/t/how-to-get-the-number-of-routing-shards-for-an-index/257634>\
**Category:** Elasticsearch\
**Created:** [December 4, 2020, 9:17am UTC](https://discuss.elastic.co/t/how-to-get-the-number-of-routing-shards-for-an-index/257634 "2020-12-04T09:17:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chelambarasan\_CR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chelambarasan_cr/32/62592_2.png) [@Chelambarasan\_CR](https://discuss.elastic.co/u/Chelambarasan_CR)\
**Post date:** [December 4, 2020, 9:17am UTC](https://discuss.elastic.co/t/how-to-get-the-number-of-routing-shards-for-an-index/257634/1 "2020-12-04T09:17:07Z")

</div>

ES version: 7.6.1  
I have mentioned the number of routing shards while index creation as below

```
PUT my_source_index
    {
        "settings": {
            "index.number_of_shards" : 9,
            "index.number_of_routing_shards" : 27
        }
    }

```

After creation of index, I tried verifying routing shard count using below command

`GET my_source_index/_settings?include_defaults`

But it was giving the count as 1.

> "number\_of\_routing\_shards" : "1"

Could you help me here on how to get the actual routing shard for an index?

Also let me know whether routing shards is removed in 7.x and can i split the 9 shard index to 27 shard index if i didn't specify number\_of\_routing\_shards while creating the source index.

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [December 6, 2020, 3:13pm UTC](https://discuss.elastic.co/t/how-to-get-the-number-of-routing-shards-for-an-index/257634/2 "2020-12-06T15:13:48Z")

</div>

> [@Chelambarasan\_CR](#):
>
> But it was giving the count as 1.

The count of `1` you are seeing is the default value for `number_of_routing_shards`. It is being returned in the `GET my_source_index/_settings?include_defaults` call because of the presence of `include_defaults`. The actual value for `number_of_routing_shards` is not returned in the index settings api. Please, refer to [this](https://github.com/elastic/elasticsearch/issues/33036#issuecomment-414809596) for more information on that subject.

> [@Chelambarasan\_CR](#):
>
> Also let me know whether routing shards is removed in 7.x and can i split the 9 shard index to 27 shard index if i didn't specify number\_of\_routing\_shards while creating the source index.

This has not been changed. The `index.number_of_routing_shards` is required and you can only set it at index creation time or on a [closed index](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html).

---

<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:** [January 3, 2021, 3:13pm UTC](https://discuss.elastic.co/t/how-to-get-the-number-of-routing-shards-for-an-index/257634/3 "2021-01-03T15:13:50Z")

</div>

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