# Using 2 search preference together

**URL:** <https://discuss.elastic.co/t/using-2-search-preference-together/15924>\
**Category:** Elasticsearch\
**Created:** [February 20, 2014, 1:33pm UTC](https://discuss.elastic.co/t/using-2-search-preference-together/15924 "2014-02-20T13:33:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casanova8](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@casanova8](https://discuss.elastic.co/u/casanova8)\
**Post date:** [February 20, 2014, 1:33pm UTC](https://discuss.elastic.co/t/using-2-search-preference-together/15924/1 "2014-02-20T13:33:09Z")

</div>

Hi All,

We are using elasticsearch version 0.90.5, Java API for our application.  
We need to specify node location "\_only\_node:" preference to search the data and "\_shards:2" preference as well. Could some one help me to use both the preference together.

Thank you in advance.

---

<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:48am UTC](https://discuss.elastic.co/t/using-2-search-preference-together/15924/2 "2017-07-06T01:48:41Z")

</div>


