# Elasticsearch shard preference when using shard allocation awareness

**URL:** <https://discuss.elastic.co/t/elasticsearch-shard-preference-when-using-shard-allocation-awareness/106053>\
**Category:** Elasticsearch\
**Created:** [November 1, 2017, 3:27pm UTC](https://discuss.elastic.co/t/elasticsearch-shard-preference-when-using-shard-allocation-awareness/106053 "2017-11-01T15:27:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eran\_Netzerel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eran_netzerel/32/23181_2.png) [@Eran\_Netzerel](https://discuss.elastic.co/u/Eran_Netzerel)\
**Post date:** [November 1, 2017, 3:27pm UTC](https://discuss.elastic.co/t/elasticsearch-shard-preference-when-using-shard-allocation-awareness/106053/1 "2017-11-01T15:27:39Z")

</div>

Hi,

We are using elasticsearch 5.3.2 and we want to deploy our ES clusters over a couple of availability zones and apply shard allocation awareness.

according to this document : [https://www.elastic.co/guide/en/elasticsearch/reference/current/allocation-awareness.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/allocation-awareness.html), it says that "When executing search or GET requests, with shard awareness enabled, Elasticsearch will prefer using local shards — shards in the same awareness group — to execute the request. This is usually faster than crossing racks or awareness zones. "

The question is - what happens when we run the query with shard preference ?  
will it override the default shard awareness behaviour which tries to execute the query against its "local" shards?

That's how we currently work with elasticsearch - [https://labs.totango.com/taming-elasticsearch-hiccups-with-async-retries-9729fbf6e192](https://labs.totango.com/taming-elasticsearch-hiccups-with-async-retries-9729fbf6e192), and we don't want our mechanism to break when we change our configuration to shard allocation awareness.

Thanks

---

<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:** [November 29, 2017, 3:28pm UTC](https://discuss.elastic.co/t/elasticsearch-shard-preference-when-using-shard-allocation-awareness/106053/2 "2017-11-29T15:28:21Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
