# How to quickly reduce the document count

**URL:** <https://discuss.elastic.co/t/how-to-quickly-reduce-the-document-count/152935>\
**Category:** Elasticsearch\
**Created:** [October 18, 2018, 5:28am UTC](https://discuss.elastic.co/t/how-to-quickly-reduce-the-document-count/152935 "2018-10-18T05:28:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![n21754](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@n21754](https://discuss.elastic.co/u/n21754)\
**Post date:** [October 18, 2018, 5:28am UTC](https://discuss.elastic.co/t/how-to-quickly-reduce-the-document-count/152935/1 "2018-10-18T05:28:47Z")

</div>

I have an elasticsearch cluster with five shards where the shards are hitting the ~2B document limit. Looking at the logs, a large fraction of those documents are deleted documents and I am hoping that I can remove some of those deleted documents via a merge to temporarily allow writes until I can do a full reindex into a larger cluster. I tried doing a "force\_merge?only\_expunge\_deletes=true" query, which helped the situation somewhat - now most of the new index operations succeed, but many still fail with a 400 error due to the document limit. The deleted count initially dropped, but has remained the same for several hours. The \_stats endpoint says that there are 5 merges currently happening, but that has not changed in several hours either.

---

<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 15, 2018, 5:38am UTC](https://discuss.elastic.co/t/how-to-quickly-reduce-the-document-count/152935/2 "2018-11-15T05:38:50Z")

</div>

Closed on November 15, 2018, 5:38am UTC

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