Hey all
I have some questions regarding routing_partition_size field.
Not sure but upon reading the documentation , this is what i understood:
By default, using a routing key will access only 1 primary shard, for indexing document and fetching.
When specifying the routing_partition_size, the routing key will now access the number of shards specified in this field.
I tried to test this. I created an index with 6 primary shards only and specified routing_partition_size with a value of 4.
curl -X PUT localhost:9200/my-index-000000 -d '{ "settings": { "number_of_shards": 6 , "number_of_replicas": 0, "index.routing_partition_size": 4}, "mappings": {"_routing": {"required": true}}}' -H "Content-Ty
pe: application/json"
So in theory when indexing documents with a given key it should be distributed among 4 priamry shards, or i belived so. But i tried to index 100k documents and they all went to the same shard
for i in {0..100000}; do curl -X POST localhost:9200/my-index-000000/_doc?routing=key1 -d '{ "data": "something" }' -H "Content-Type: application/json"; done
curl -X GET localhost:9200/_cat/shards?v
my-index-000000 2 p STARTED 0 226b 172.20.0.4 es02
my-index-000000 5 p STARTED 0 226b 172.20.0.4 es02
my-index-000000 3 p STARTED 0 226b 172.20.0.2 es03
my-index-000000 1 p STARTED 0 226b 172.20.0.3 es01
my-index-000000 4 p STARTED 0 226b 172.20.0.3 es01
my-index-000000 0 p STARTED 100001 2.7mb 172.20.0.2 es03
Am i missing something, or did i understood this wrong?
Thanks in advance for the help
And happy new year