# How delete document works?

**URL:** <https://discuss.elastic.co/t/how-delete-document-works/36977>\
**Category:** Elasticsearch\
**Created:** [December 11, 2015, 12:34pm UTC](https://discuss.elastic.co/t/how-delete-document-works/36977 "2015-12-11T12:34:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felipe\_Santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felipe_santos/32/3511_2.png) [@Felipe\_Santos](https://discuss.elastic.co/u/Felipe_Santos)\
**Post date:** [December 11, 2015, 12:34pm UTC](https://discuss.elastic.co/t/how-delete-document-works/36977/1 "2015-12-11T12:34:52Z")

</div>

I heard when we delete a document it remains on disks and next queries will filter deleted documents, is it true?

---

<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:** [December 11, 2015, 1:07pm UTC](https://discuss.elastic.co/t/how-delete-document-works/36977/2 "2015-12-11T13:07:05Z")

</div>

Segments are immutables so yes technically they are still on the disk until the next merge.

---

<div class="post-metadata">

**Author:** ![ashwin2011](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ashwin2011](https://discuss.elastic.co/u/ashwin2011)\
**Post date:** [December 11, 2015, 1:07pm UTC](https://discuss.elastic.co/t/how-delete-document-works/36977/3 "2015-12-11T13:07:20Z")

</div>

Yes its true, when you issue this command : "GET /\_cat/indices?v " on sense , you will see the doc.deleted increases.

---

<div class="post-metadata">

**Author:** ![Felipe\_Santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felipe_santos/32/3511_2.png) [@Felipe\_Santos](https://discuss.elastic.co/u/Felipe_Santos)\
**Post date:** [December 11, 2015, 1:09pm UTC](https://discuss.elastic.co/t/how-delete-document-works/36977/4 "2015-12-11T13:09:12Z")

</div>

So the search performance decreases? Until next merge?

---

<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:** [December 11, 2015, 1:24pm UTC](https://discuss.elastic.co/t/how-delete-document-works/36977/5 "2015-12-11T13:24:41Z")

</div>

You should not really notice.

---

<div class="post-metadata">

**Author:** ![mikemccand](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@mikemccand](https://discuss.elastic.co/u/mikemccand)\
**Post date:** [December 11, 2015, 2:06pm UTC](https://discuss.elastic.co/t/how-delete-document-works/36977/6 "2015-12-11T14:06:00Z")

</div>

See [https://www.elastic.co/blog/lucenes-handling-of-deleted-documents](https://www.elastic.co/blog/lucenes-handling-of-deleted-documents) for more details.

---

<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, 11:31pm UTC](https://discuss.elastic.co/t/how-delete-document-works/36977/7 "2017-07-05T23:31:47Z")

</div>


