# Searching with indices hint does not perform better

**URL:** <https://discuss.elastic.co/t/searching-with-indices-hint-does-not-perform-better/56931>\
**Category:** Elasticsearch\
**Created:** [August 1, 2016, 9:22pm UTC](https://discuss.elastic.co/t/searching-with-indices-hint-does-not-perform-better/56931 "2016-08-01T21:22:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![graineri](https://avatars.discourse-cdn.com/v4/letter/g/d78d45/32.png) [@graineri](https://discuss.elastic.co/u/graineri)\
**Post date:** [August 1, 2016, 9:22pm UTC](https://discuss.elastic.co/t/searching-with-indices-hint-does-not-perform-better/56931/1 "2016-08-01T21:22:41Z")

</div>

It seems that providing a set of indices when performing a search using the Java Client does not perform better than without that hint.

For example:  
1)  
`elasticSearchClient .prepareSearch("index-1", "index-2", "index3") .setIndicesOptions(IndicesOptions.lenientExpandOpen()) .setQuery(...) .setTypes(...) .setExplain(false) .get()`

1. 

`elasticSearchClient .prepareSearch() .setQuery(...) .setTypes(...) .setExplain(false) .get()`

The second query performs way better (e.g. takes less time) than the first one.

Have you ever come across a similar situation?

ES Version: 2.3.3

---

<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 5, 2017, 10:31pm UTC](https://discuss.elastic.co/t/searching-with-indices-hint-does-not-perform-better/56931/2 "2017-07-05T22:31:03Z")

</div>

Closed on July 5, 2017, 10:31pm UTC


