# How to enable routing in ES v2.0

**URL:** <https://discuss.elastic.co/t/how-to-enable-routing-in-es-v2-0/38868>\
**Category:** Elasticsearch\
**Created:** [January 11, 2016, 11:13am UTC](https://discuss.elastic.co/t/how-to-enable-routing-in-es-v2-0/38868 "2016-01-11T11:13:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aantony](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@aantony](https://discuss.elastic.co/u/aantony)\
**Post date:** [January 11, 2016, 11:13am UTC](https://discuss.elastic.co/t/how-to-enable-routing-in-es-v2-0/38868/1 "2016-01-11T11:13:27Z")

</div>

Currently we are using ElasticSearch v2.0 and we are making use of this to read our application log files and create indexes using ElasticSearch. We have read of using Routing to enhance performance.  
We were looking at ways to route data using a field other than uid. Any ways to route based on a field in the log file using ElasticSearch v2.0, so that fields of a particular type are routed to a particular shard.

---

<div class="post-metadata">

**Author:** ![msimos](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@msimos](https://discuss.elastic.co/u/msimos)\
**Post date:** [January 12, 2016, 12:33am UTC](https://discuss.elastic.co/t/how-to-enable-routing-in-es-v2-0/38868/2 "2016-01-12T00:33:34Z")

</div>

Hi,

You need to pass the value at index & query time as a parameter. In Elasticsearch 2.0 you can't use a field to extract the routing id. However you may want to re-think using document routing since ultimately what can happen is that the distribution isn't even. So some shards will be much larger then others and you end up with hot spots where nodes with larger shards end up doing most of the work. Then you need to re-index your data to put larger users in their own index.

---

<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:** [January 12, 2016, 1:23am UTC](https://discuss.elastic.co/t/how-to-enable-routing-in-es-v2-0/38868/3 "2016-01-12T01:23:27Z")

</div>

Like Mike alluded to, I wouldn't recommend routing for this use case.

---

<div class="post-metadata">

**Author:** ![aantony](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@aantony](https://discuss.elastic.co/u/aantony)\
**Post date:** [January 12, 2016, 7:55am UTC](https://discuss.elastic.co/t/how-to-enable-routing-in-es-v2-0/38868/4 "2016-01-12T07:55:19Z")

</div>

Thanks for the response. Just to add a bit more of details. I am using FluentD to collect data and send it across to elasticSearch using the plugin [https://github.com/uken/fluent-plugin-elasticsearch](https://github.com/uken/fluent-plugin-elasticsearch). In that case is there a way to configure the document routing.

The fluentD configuration is as follows:  
  
type elasticsearch  
include\_tag\_key true  
tag\_key tag  
logstash\_format true  
logstash\_prefix logtest4  
hosts a.b.c.d:9200,a.b.c.d:9200  
#buffering  
buffer\_type file  
buffer\_path /datadrive/buffer/td  
buffer\_chunk\_limit 16m  
buffer\_queue\_limit 16384  
flush\_interval 5m  
retry\_wait 15s  
request\_timeout 15s  
num\_threads 2  
type\_name log  
log\_level trace

---

<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:** [January 12, 2016, 8:43am UTC](https://discuss.elastic.co/t/how-to-enable-routing-in-es-v2-0/38868/5 "2016-01-12T08:43:50Z")

</div>

That doesn't really change the recommendations 🙂

---

<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, 11:25pm UTC](https://discuss.elastic.co/t/how-to-enable-routing-in-es-v2-0/38868/6 "2017-07-05T23:25:16Z")

</div>


