# Routing to an Index Partition - Custom Routing

**URL:** <https://discuss.elastic.co/t/routing-to-an-index-partition-custom-routing/284240>\
**Category:** Elasticsearch\
**Created:** [September 15, 2021, 3:28am UTC](https://discuss.elastic.co/t/routing-to-an-index-partition-custom-routing/284240 "2021-09-15T03:28:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudhir-ch](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@sudhir-ch](https://discuss.elastic.co/u/sudhir-ch)\
**Post date:** [September 15, 2021, 3:28am UTC](https://discuss.elastic.co/t/routing-to-an-index-partition-custom-routing/284240/1 "2021-09-15T03:28:31Z")

</div>

Hi,  
I have configured the index such that custom routing values will go to a subset of the shards rather than a single shard by providing the index level setting "index.routing\_partition\_size" at index creation.

Index Creation:

```auto
PUT /test_sharding.partition
{
"settings": {
"number_of_shards": 3,
"routing_partition_size": 2
},
"mappings": {
"_routing": {
"required": true
}
}
}

```

```auto
PUT /test_sharding.partition/_doc/1?routing=202109
{
"data" : "test data"
}

```

With the same routing key i have inserted around 300k documents in to the index. I expect that docs should distribute between 2 shards, because "routing\_partition\_size" is configured as 2. But all the docs are going to only one shard.

I'm not getting much information on this. Can you please help on this.

---

<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:** [October 13, 2021, 3:28am UTC](https://discuss.elastic.co/t/routing-to-an-index-partition-custom-routing/284240/2 "2021-10-13T03:28:37Z")

</div>

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