til icon indicating copy to clipboard operation
til copied to clipboard

routing field in Elasticsearch

Open xluffy opened this issue 3 years ago • 0 comments

https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-routing-field.html

TLDR:

Document is routed to a particular shard in an index using the following formula:

shard_num = hash(_routing) % num_primary_shards

The default value used for _routing is the document’s _id.

https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/cluster/routing/Murmur3HashFunction.java

xluffy avatar Jul 06 '21 05:07 xluffy