# Translate the hash to shard id

**URL:** <https://discuss.elastic.co/t/translate-the-hash-to-shard-id/59532>\
**Category:** Elasticsearch\
**Created:** [September 1, 2016, 10:25am UTC](https://discuss.elastic.co/t/translate-the-hash-to-shard-id/59532 "2016-09-01T10:25:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gacio](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@gacio](https://discuss.elastic.co/u/gacio)\
**Post date:** [September 1, 2016, 10:25am UTC](https://discuss.elastic.co/t/translate-the-hash-to-shard-id/59532/1 "2016-09-01T10:25:48Z")

</div>

The shard nr is evaluated as follows:  
`new Murmur3HashFunction().hash("route2") % SHARD_NR`

How is it mapped to the **shard id** or **shard name** values?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 1, 2016, 10:28am UTC](https://discuss.elastic.co/t/translate-the-hash-to-shard-id/59532/2 "2016-09-01T10:28:26Z")

</div>

Does this relate to [How to calculate the shard id/name for given routing string?](https://discuss.elastic.co/t/how-to-calculate-the-shard-id-name-for-given-routing-string/59529)?

---

<div class="post-metadata">

**Author:** ![gacio](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@gacio](https://discuss.elastic.co/u/gacio)\
**Post date:** [September 1, 2016, 11:19am UTC](https://discuss.elastic.co/t/translate-the-hash-to-shard-id/59532/3 "2016-09-01T11:19:58Z")

</div>

Well in some way yes.

---

<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:** [July 5, 2017, 10:23pm UTC](https://discuss.elastic.co/t/translate-the-hash-to-shard-id/59532/4 "2017-07-05T22:23:18Z")

</div>


