# Is there a way to keep the results of a search?

**URL:** <https://discuss.elastic.co/t/is-there-a-way-to-keep-the-results-of-a-search/51469>\
**Category:** Elasticsearch\
**Created:** [May 31, 2016, 5:51pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-keep-the-results-of-a-search/51469 "2016-05-31T17:51:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![psilos](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@psilos](https://discuss.elastic.co/u/psilos)\
**Post date:** [May 31, 2016, 5:51pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-keep-the-results-of-a-search/51469/1 "2016-05-31T17:51:23Z")

</div>

Hi, imagine the scenario that a user searches for "tv". A number of docs match (say 1000 results). Then the user applies some filters , say inches size, Hz, price etc.  
Is there a way that ES keeps the results of the previous search and applies the filters only to those results rather than making a fresh search across all the docs?  
I know ES use a cache but I think it works when the user makes exactly the same search. Is that right or am i missing something?

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [May 31, 2016, 8:58pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-keep-the-results-of-a-search/51469/2 "2016-05-31T20:58:27Z")

</div>

The cache that you're likely to get the most benefit out of here is lower-level, it applies on the Lucene side on a per-filter basis. This means that if you send a query, then send the same query with an additional filter, then the same again with another additional filter, each filter part (let's assume they're different clauses in a bool `filter` clause) can be cached individually.

Hopefully that helps, there really isn't a need to keep the results of a search in their entirety.

---

<div class="post-metadata">

**Author:** ![psilos](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@psilos](https://discuss.elastic.co/u/psilos)\
**Post date:** [May 31, 2016, 10:17pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-keep-the-results-of-a-search/51469/3 "2016-05-31T22:17:26Z")

</div>

Thnx dakrone. Do i need to configure the Lucene's cache or does it work out of the box?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 1, 2016, 12:50am UTC](https://discuss.elastic.co/t/is-there-a-way-to-keep-the-results-of-a-search/51469/4 "2016-06-01T00:50:50Z")

</div>

It's automatic, you don't need to do anything.

---

<div class="post-metadata">

**Author:** ![psilos](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@psilos](https://discuss.elastic.co/u/psilos)\
**Post date:** [June 1, 2016, 7:24am UTC](https://discuss.elastic.co/t/is-there-a-way-to-keep-the-results-of-a-search/51469/5 "2016-06-01T07:24:20Z")

</div>

Thnx Mark !

---

<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:47pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-keep-the-results-of-a-search/51469/6 "2017-07-05T22:47:24Z")

</div>


