How to get the number of routing shards for an index

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.

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 for more information on that subject.

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.

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