# Trouble with search preference=\_local

**URL:** <https://discuss.elastic.co/t/trouble-with-search-preference--local/19764>\
**Category:** Elasticsearch\
**Created:** [September 12, 2014, 7:37pm UTC](https://discuss.elastic.co/t/trouble-with-search-preference--local/19764 "2014-09-12T19:37:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kurt\_Hutchison](https://avatars.discourse-cdn.com/v4/letter/k/e56c9b/32.png) [@Kurt\_Hutchison](https://discuss.elastic.co/u/Kurt_Hutchison)\
**Post date:** [September 12, 2014, 7:37pm UTC](https://discuss.elastic.co/t/trouble-with-search-preference--local/19764/1 "2014-09-12T19:37:55Z")

</div>

I have ES 1.0.2 and Lucene 4.6.

I was hoping preference=\_local would query on the current node, but it does  
not.

The same node comes up at the top of the list for all shards regardless of  
which node I search from,  
it is not the primary node, neither is it the local node.

I am testing this with the \_search\_shards API like this:

curl-XGET localhost:9200/2/\_search\_shards?preference=\_local

The larger problem I am trying to solve is to restrict searches to a geo, we  
are a two geo site  
and don't want searches going across the WAN.

I have experimented with allocation awareness, also with mixed results,  
searches  
always go to the first zone, this might actually be workable since we are a  
primary/DR  
setup, but it is not behaving as documented so I am leery of relying on this  
behavior.

--  
View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Trouble-with-search-preference-local-tp4063439.html](http://elasticsearch-users.115913.n3.nabble.com/Trouble-with-search-preference-local-tp4063439.html)  
Sent from the ElasticSearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
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/1410550675399-4063439.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1410550675399-4063439.post%40n3.nabble.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, 1:02am UTC](https://discuss.elastic.co/t/trouble-with-search-preference--local/19764/2 "2017-07-06T01:02:41Z")

</div>


