# Trouble with search preference=\_local

**URL:** <https://discuss.elastic.co/t/trouble-with-search-preference--local/19765>\
**Category:** Elasticsearch\
**Created:** [September 12, 2014, 8:05pm UTC](https://discuss.elastic.co/t/trouble-with-search-preference--local/19765 "2014-09-12T20:05:44Z")\
**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, 8:05pm UTC](https://discuss.elastic.co/t/trouble-with-search-preference--local/19765/1 "2014-09-12T20:05:44Z")

</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 (not forced), 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.

--  
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/ceabad94-f86c-40c6-a098-e4ea2381abfe%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ceabad94-f86c-40c6-a098-e4ea2381abfe%40googlegroups.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/19765/2 "2017-07-06T01:02:41Z")

</div>


