# ES 7.0 takes longer to respond the first search query

**URL:** https://discuss.elastic.co/t/es-7-0-takes-longer-to-respond-the-first-search-query/182656
**Category:** Elasticsearch
**Tags:** elastic-stack-monitoring
**Created:** [May 24, 2019, 1:16pm UTC](https://discuss.elastic.co/t/es-7-0-takes-longer-to-respond-the-first-search-query/182656 "2019-05-24T13:16:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![aaiaaba123](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@aaiaaba123](https://discuss.elastic.co/u/aaiaaba123)
#### Post date: [May 24, 2019, 1:16pm UTC](https://discuss.elastic.co/t/es-7-0-takes-longer-to-respond-the-first-search-query/182656/1 "2019-05-24T13:16:12Z")

</div>

Seeing a performance issue in ES.

When we run 2 queries with a gap of 10-15 mins, the query runs very slow.

Subsequent queries running back to back are very fast but when we give a gap of 10-15 mins, first query takes longer to give results.

Could you please help in solving this issue. We need all es queries results within 1 sec.

Thanks 🙂

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [May 31, 2019, 9:15am UTC](https://discuss.elastic.co/t/es-7-0-takes-longer-to-respond-the-first-search-query/182656/2 "2019-05-31T09:15:57Z")

</div>

Are you indexing documents into the indices that you are searching? Do you have `index.refresh_interval` set on all the indices that you are searching? If the answers are "yes" and "no" then Elasticsearch stops doing background refreshes to improve indexing performance, but the first search after a gap will need to refresh first, and this can take some time. You can disable this optimisation by setting `index.refresh_interval` to an appropriate value on these indices.

---

<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: [June 28, 2019, 9:15am UTC](https://discuss.elastic.co/t/es-7-0-takes-longer-to-respond-the-first-search-query/182656/3 "2019-06-28T09:15:57Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
