til
til copied to clipboard
routing field in Elasticsearch
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