# Routing explained

**URL:** <https://discuss.elastic.co/t/routing-explained/5353>\
**Category:** Elasticsearch\
**Created:** [September 12, 2011, 8:59am UTC](https://discuss.elastic.co/t/routing-explained/5353 "2011-09-12T08:59:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steff](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Steff](https://discuss.elastic.co/u/Steff)\
**Post date:** [September 12, 2011, 8:59am UTC](https://discuss.elastic.co/t/routing-explained/5353/1 "2011-09-12T08:59:00Z")

</div>

Hi

I think the routing-feature in ES needs a little more explanation, than  
what I am able to find in the guide on  
[http://www.elasticsearch.org/guide/](http://www.elasticsearch.org/guide/).  
[http://www.elasticsearch.org/guide/reference/mapping/routing-field.html](http://www.elasticsearch.org/guide/reference/mapping/routing-field.html)  
says something about how to set routing field, but nothing about exactly  
what routing means and does for you, and how it works. I expect that the  
routing field in general controls which shards ES will contact in order  
to execute an "operation" (index, get, search etc.). Is that true?

Exactly what "guaranteed properties" does routing bring to the table? I  
believe I've read somewhere that it is guaranteed that documents with  
the same value for the routing field will always be indexed in the same  
shard. Is that true? Other things worth mentioning about what routing  
does for you? A little more documentation, not only on how to use it,  
but also on how it works and what it does for you, would be nice.

Thanks!

Regards, Per Steffensen

---

<div class="post-metadata">

**Author:** ![Benjamin\_Deveze](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_deveze/32/1577_2.png) [@Benjamin\_Deveze](https://discuss.elastic.co/u/Benjamin_Deveze)\
**Post date:** [September 12, 2011, 9:04am UTC](https://discuss.elastic.co/t/routing-explained/5353/2 "2011-09-12T09:04:29Z")

</div>

If no routing is specified the targeted shard of a document is based on the  
id of the document.

If you use routing the targeted shard is based on the provided routing so  
the same value of routing field will always lead to the same shard.

Note that the \_parent property can also be used for shard computation.

---

<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 6, 2017, 3:54am UTC](https://discuss.elastic.co/t/routing-explained/5353/3 "2017-07-06T03:54:44Z")

</div>


