# Deleting data while indexing

**URL:** <https://discuss.elastic.co/t/deleting-data-while-indexing/345565>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [October 23, 2023, 12:17pm UTC](https://discuss.elastic.co/t/deleting-data-while-indexing/345565 "2023-10-23T12:17:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lilia](https://avatars.discourse-cdn.com/v4/letter/l/2bfe46/32.png) [@Lilia](https://discuss.elastic.co/u/Lilia)\
**Post date:** [October 23, 2023, 12:17pm UTC](https://discuss.elastic.co/t/deleting-data-while-indexing/345565/1 "2023-10-23T12:17:34Z")

</div>

Hi all,  
I have a case where i need to delete data while it is indexing, to stop the process. Is this possible and if yes, can you explain me how to do it? The case is as follow i want to delete a report while it is uploading and some data is calculated in the backend. The problem is, when i send a delete query it actually delete the data which is already calculated, but because the process is still on going the backend still send data to elastic. So when i refresh the page, and fetch all uploaded reports, the one that i already deleted, appears with the data received after the delete request has been send. For example if the whole report should have 100 rows of data and i delete in the middle of calculaltion up to 58 rows, on refresh i will receive the next 42 rows, so my goal is to stop the process of indexing and not to receive any more data connected to this report. Thank you in advance 🙂

---

<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:** [October 23, 2023, 12:37pm UTC](https://discuss.elastic.co/t/deleting-data-while-indexing/345565/2 "2023-10-23T12:37:19Z")

</div>

What is indexing the data?

---

<div class="post-metadata">

**Author:** ![Lilia](https://avatars.discourse-cdn.com/v4/letter/l/2bfe46/32.png) [@Lilia](https://discuss.elastic.co/u/Lilia)\
**Post date:** [October 24, 2023, 7:07am UTC](https://discuss.elastic.co/t/deleting-data-while-indexing/345565/3 "2023-10-24T07:07:01Z")

</div>

Hey,  
the backend is sending data to elastic to index it.  
Not sure if this is the answer that you wanted if you need more details, please let me know. Thansk!

---

<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:** [October 24, 2023, 8:06am UTC](https://discuss.elastic.co/t/deleting-data-while-indexing/345565/4 "2023-10-24T08:06:05Z")

</div>

So what about stopping sending documents from the backend?

---

<div class="post-metadata">

**Author:** ![Sunile\_Manjee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sunile_manjee/32/111461_2.png) [@Sunile\_Manjee](https://discuss.elastic.co/u/Sunile_Manjee)\
**Post date:** [October 25, 2023, 4:21am UTC](https://discuss.elastic.co/t/deleting-data-while-indexing/345565/5 "2023-10-25T04:21:16Z")

</div>

> [@Lilia](#):
>
> the one that i already deleted, appears with the data received after the delete request has been send. For example if the whole report should have 100

have you looked into blocking writes on your index? [Index blocks | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-blocks.html#index-modules-blocks)

---

<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:** [November 22, 2023, 4:21am UTC](https://discuss.elastic.co/t/deleting-data-while-indexing/345565/6 "2023-11-22T04:21:29Z")

</div>

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