# Storage or query history. Is it possible to store it temporarily?

**URL:** <https://discuss.elastic.co/t/storage-or-query-history-is-it-possible-to-store-it-temporarily/178547>\
**Category:** Elasticsearch\
**Created:** [April 25, 2019, 11:56pm UTC](https://discuss.elastic.co/t/storage-or-query-history-is-it-possible-to-store-it-temporarily/178547 "2019-04-25T23:56:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EliuFlorez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eliuflorez/32/40884_2.png) [@EliuFlorez](https://discuss.elastic.co/u/EliuFlorez)\
**Post date:** [April 25, 2019, 11:56pm UTC](https://discuss.elastic.co/t/storage-or-query-history-is-it-possible-to-store-it-temporarily/178547/1 "2019-04-25T23:56:12Z")

</div>

Storage or query history. Is it possible to store it temporarily?

I pose the question since I have more than 1 million documents which have categories and locations.

To know how many documents exist in such category or location implement aggregation. but at the same time the aggregation I must paginate them or implement Scroll. In order to be able to return all the buckets.

But when reloading the page or click F5 the aggregation process becomes clear as it should be and returns to perform the calculation.

Is there any way for that aggregation result to be stored in another index temporarily by dates?

Since the aggregations exceeds 200 thousand buckets and the documents to show are only 10.

Any ideas or suggestions?

Thanks and regards. 🙂

---

<div class="post-metadata">

**Author:** ![gabriel\_tessier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gabriel_tessier/32/27911_2.png) [@gabriel\_tessier](https://discuss.elastic.co/u/gabriel_tessier)\
**Post date:** [April 26, 2019, 3:14am UTC](https://discuss.elastic.co/t/storage-or-query-history-is-it-possible-to-store-it-temporarily/178547/2 "2019-04-26T03:14:51Z")

</div>

Hi,

If you are looking for paginate over your aggregations did you try the composite aggregation:  
[https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-aggregations-bucket-composite-aggregation.html#\_after](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-aggregations-bucket-composite-aggregation.html#_after)

---

<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:** [May 24, 2019, 3:14am UTC](https://discuss.elastic.co/t/storage-or-query-history-is-it-possible-to-store-it-temporarily/178547/3 "2019-05-24T03:14:52Z")

</div>

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