# Force search on a local node?

**URL:** <https://discuss.elastic.co/t/force-search-on-a-local-node/22026>\
**Category:** Elasticsearch\
**Created:** [February 7, 2015, 7:15pm UTC](https://discuss.elastic.co/t/force-search-on-a-local-node/22026 "2015-02-07T19:15:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![codemasterg](https://avatars.discourse-cdn.com/v4/letter/c/dec6dc/32.png) [@codemasterg](https://discuss.elastic.co/u/codemasterg)\
**Post date:** [February 7, 2015, 7:15pm UTC](https://discuss.elastic.co/t/force-search-on-a-local-node/22026/1 "2015-02-07T19:15:05Z")

</div>

Hi -

I am new to Elasticsearch and have what I hope is a basic question for a  
simple configuration. Assume I have 3 node cluster with a single index and:

- 1 primary shard
- 2 replicas of the primary shard

The majority of requests will be searches with relatively few index updates.

All requests are distributed by a network load balancer across the three  
nodes. Since each node has a copy of the index and the requests are being  
spread across the cluster by the network load balancer, my intuition is  
that a local search (i.e. execute a search on the node that received the  
request) will perform best. In other words, I do not want Elasticsearch to  
round-robin each search request from the node received to another node; I  
want the node that received the request to search its local copy of the  
index.

My question: Is there a way for make Elasticsearch search against only the  
shard on the node received (and avoid a network hop to another shard)?

Thanks very much.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b4289cc5-7981-443f-a26c-569b271cda3a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b4289cc5-7981-443f-a26c-569b271cda3a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [February 7, 2015, 8:03pm UTC](https://discuss.elastic.co/t/force-search-on-a-local-node/22026/2 "2015-02-07T20:03:03Z")

</div>

> **[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.

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
[Lucene.NET](http://Lucene.NET) committer and PMC member

On Sat, Feb 7, 2015 at 9:15 PM, codemasterg [gtotsline@gmail.com](mailto:gtotsline@gmail.com) wrote:

> Hi -
> 
> I am new to Elasticsearch and have what I hope is a basic question for a  
> simple configuration. Assume I have 3 node cluster with a single index and:
> 
> - 1 primary shard
> - 2 replicas of the primary shard
> 
> The majority of requests will be searches with relatively few index  
> updates.
> 
> All requests are distributed by a network load balancer across the three  
> nodes. Since each node has a copy of the index and the requests are being  
> spread across the cluster by the network load balancer, my intuition is  
> that a local search (i.e. execute a search on the node that received the  
> request) will perform best. In other words, I do not want Elasticsearch to  
> round-robin each search request from the node received to another node; I  
> want the node that received the request to search its local copy of the  
> index.
> 
> My question: Is there a way for make Elasticsearch search against only the  
> shard on the node received (and avoid a network hop to another shard)?
> 
> Thanks very much.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/b4289cc5-7981-443f-a26c-569b271cda3a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b4289cc5-7981-443f-a26c-569b271cda3a%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/b4289cc5-7981-443f-a26c-569b271cda3a%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b4289cc5-7981-443f-a26c-569b271cda3a%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zvqw8CnzAYfMg7-zGnv-4tQ2izPAi8Bo1z8xDyHao7jHQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zvqw8CnzAYfMg7-zGnv-4tQ2izPAi8Bo1z8xDyHao7jHQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![codemasterg](https://avatars.discourse-cdn.com/v4/letter/c/dec6dc/32.png) [@codemasterg](https://discuss.elastic.co/u/codemasterg)\
**Post date:** [February 7, 2015, 8:08pm UTC](https://discuss.elastic.co/t/force-search-on-a-local-node/22026/3 "2015-02-07T20:08:27Z")

</div>

Itamar - perfect, thanks very much!

On Sat, Feb 7, 2015 at 3:03 PM, Itamar Syn-Hershko [itamar@code972.com](mailto:itamar@code972.com)  
wrote:

> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-preference.html)
> 
> --
> 
> Itamar Syn-Hershko  
> [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> Freelance Developer & Consultant  
> [Lucene.NET](http://Lucene.NET) committer and PMC member
> 
> On Sat, Feb 7, 2015 at 9:15 PM, codemasterg [gtotsline@gmail.com](mailto:gtotsline@gmail.com) wrote:
> 
> > Hi -
> > 
> > I am new to Elasticsearch and have what I hope is a basic question for a  
> > simple configuration. Assume I have 3 node cluster with a single index and:
> > 
> > - 1 primary shard
> > - 2 replicas of the primary shard
> > 
> > The majority of requests will be searches with relatively few index  
> > updates.
> > 
> > All requests are distributed by a network load balancer across the three  
> > nodes. Since each node has a copy of the index and the requests are being  
> > spread across the cluster by the network load balancer, my intuition is  
> > that a local search (i.e. execute a search on the node that received the  
> > request) will perform best. In other words, I do not want Elasticsearch to  
> > round-robin each search request from the node received to another node; I  
> > want the node that received the request to search its local copy of the  
> > index.
> > 
> > My question: Is there a way for make Elasticsearch search against only  
> > the shard on the node received (and avoid a network hop to another shard)?
> > 
> > Thanks very much.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/b4289cc5-7981-443f-a26c-569b271cda3a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b4289cc5-7981-443f-a26c-569b271cda3a%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/b4289cc5-7981-443f-a26c-569b271cda3a%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b4289cc5-7981-443f-a26c-569b271cda3a%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/eDk\_zSFZArk/unsubscribe](https://groups.google.com/d/topic/elasticsearch/eDk_zSFZArk/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zvqw8CnzAYfMg7-zGnv-4tQ2izPAi8Bo1z8xDyHao7jHQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zvqw8CnzAYfMg7-zGnv-4tQ2izPAi8Bo1z8xDyHao7jHQ%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zvqw8CnzAYfMg7-zGnv-4tQ2izPAi8Bo1z8xDyHao7jHQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zvqw8CnzAYfMg7-zGnv-4tQ2izPAi8Bo1z8xDyHao7jHQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CA%2BJa1jbP%2Bn4pKeYCce4e6Om%3DhvkSqP%3DZRx07JHQj1Frec0snhg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2BJa1jbP%2Bn4pKeYCce4e6Om%3DhvkSqP%3DZRx07JHQj1Frec0snhg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:34am UTC](https://discuss.elastic.co/t/force-search-on-a-local-node/22026/4 "2017-07-06T00:34:20Z")

</div>


