# Would flush solve my case?

**URL:** <https://discuss.elastic.co/t/would-flush-solve-my-case/269392>\
**Category:** Elasticsearch\
**Created:** [April 7, 2021, 3:37am UTC](https://discuss.elastic.co/t/would-flush-solve-my-case/269392 "2021-04-07T03:37:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecarmona](https://avatars.discourse-cdn.com/v4/letter/e/c57346/32.png) [@ecarmona](https://discuss.elastic.co/u/ecarmona)\
**Post date:** [April 7, 2021, 3:37am UTC](https://discuss.elastic.co/t/would-flush-solve-my-case/269392/1 "2021-04-07T03:37:34Z")

</div>

Hi Elastic Team,

I am indexing various documents that relate to the execution of Processes within a Database. Basically each document stores the name of the process,the start and end date of the process, time elapsed between the start and end times. Soon after I execute an aggs query to get the number of executions, the last time any given process was executed, and other stats; the aggs query feeds a pdf report to be sent out by e-mail. I've noticed that frequently I am missing processes executions (i.e. If a process has been executed 20 times, the report states that it has been executed 19, the latter corresponding the penultimate execution) however if I execute the Aggs Query manually via Kibana console I can see all the executions.

The above lead me to the conclusion that I should perform a flush before generating the aggs query. I added a small wait of 1 minute between the indexation and Aggs query, and solved the problem. However waiting is not the best solution in my case. Would Flush help me? would be this recommended? are there any recommended practices regarding Flush?

Regards,

Erik

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 7, 2021, 6:28am UTC](https://discuss.elastic.co/t/would-flush-solve-my-case/269392/2 "2021-04-07T06:28:28Z")

</div>

You probably meant refresh and not flush.

Have a look at [?refresh | Elasticsearch Guide [7.12] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.12/docs-refresh.html)

---

<div class="post-metadata">

**Author:** ![ecarmona](https://avatars.discourse-cdn.com/v4/letter/e/c57346/32.png) [@ecarmona](https://discuss.elastic.co/u/ecarmona)\
**Post date:** [April 7, 2021, 6:31am UTC](https://discuss.elastic.co/t/would-flush-solve-my-case/269392/3 "2021-04-07T06:31:23Z")

</div>

Hi @dadoonet,

thanks. I missed refresh... for some reason flush was more latent in my head. I will add the refresh on these transactions and that should do it.

Thanks again!

Erik

---

<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 5, 2021, 6:32am UTC](https://discuss.elastic.co/t/would-flush-solve-my-case/269392/4 "2021-05-05T06:32:01Z")

</div>

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