# Does a query have preference for other nodes shards?

**URL:** <https://discuss.elastic.co/t/does-a-query-have-preference-for-other-nodes-shards/6805>\
**Category:** Elasticsearch\
**Created:** [February 25, 2012, 1:36am UTC](https://discuss.elastic.co/t/does-a-query-have-preference-for-other-nodes-shards/6805 "2012-02-25T01:36:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Onilton\_Maciel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/onilton_maciel/32/2500_2.png) [@Onilton\_Maciel](https://discuss.elastic.co/u/Onilton_Maciel)\
**Post date:** [February 25, 2012, 1:36am UTC](https://discuss.elastic.co/t/does-a-query-have-preference-for-other-nodes-shards/6805/1 "2012-02-25T01:36:21Z")

</div>

I have 4 nodes with 4 shards in each nodes.

node 1 - s1 s2 s3 s4  
node 2 - s1 s2 s3 s4  
node 3 - s1 s2 s3 s4  
node 4 - s1 s2 s3 s4

Does a query issued to node1 get forwarded to all shards in node 1 or just  
one shard of this node?

Can it be directed to more then one shard in node 1? Or to all of them?

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [February 25, 2012, 12:07pm UTC](https://discuss.elastic.co/t/does-a-query-have-preference-for-other-nodes-shards/6805/2 "2012-02-25T12:07:00Z")

</div>

On Fri, 2012-02-24 at 21:36 -0400, Onilton Maciel wrote:

> I have 4 nodes with 4 shards in each nodes.
> 
> node 1 - s1 s2 s3 s4  
> node 2 - s1 s2 s3 s4  
> node 3 - s1 s2 s3 s4  
> node 4 - s1 s2 s3 s4
> 
> Does a query issued to node1 get forwarded to all shards in node 1 or  
> just one shard of this node?

Shards are round robin'ed (i think). Your query would be forwarded to  
s1,s2,s3,s4 but these shards may be on any of the nodes in your cluster.

> Can it be directed to more then one shard in node 1? Or to all of  
> them?

See search preference:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

>

---

<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:38am UTC](https://discuss.elastic.co/t/does-a-query-have-preference-for-other-nodes-shards/6805/3 "2017-07-06T03:38:22Z")

</div>

Closed on July 6, 2017, 3:38am UTC


