# Document deletion is painfully slow with self-hosted app-search

**URL:** <https://discuss.elastic.co/t/document-deletion-is-painfully-slow-with-self-hosted-app-search/212914>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [December 24, 2019, 5:09am UTC](https://discuss.elastic.co/t/document-deletion-is-painfully-slow-with-self-hosted-app-search/212914 "2019-12-24T05:09:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![The-Big-K](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the-big-k/32/56199_2.png) [@The-Big-K](https://discuss.elastic.co/u/The-Big-K)\
**Post date:** [December 24, 2019, 5:09am UTC](https://discuss.elastic.co/t/document-deletion-is-painfully-slow-with-self-hosted-app-search/212914/1 "2019-12-24T05:09:12Z")

</div>

I'm currently testing app-search locally and have setup ES + App Search latest version (7.5.1). I'm also making use of the official PHP client: [GitHub - elastic/app-search-php: Elastic App Search Official PHP Client](https://github.com/elastic/app-search-php) to test.

I added about 2500 records (documents) in an engine and later decided to delete all of them. Since deleting the engine won't delete the documents, I decided loop over each document and delete them using IDs.

Turns out that deleting each document is painfully slow - taking about ~2 seconds for each. I also tried feeding array of 100 Ids to delete; but it still takes about the same time.

Is this the expected behavior? Is there any way to speed this up?

PS: Also want to know if the self-hosted app-search is limited to indexing 100,000 documents?

---

<div class="post-metadata">

**Author:** ![orhantoy](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@orhantoy](https://discuss.elastic.co/u/orhantoy)\
**Post date:** [December 30, 2019, 9:50am UTC](https://discuss.elastic.co/t/document-deletion-is-painfully-slow-with-self-hosted-app-search/212914/2 "2019-12-30T09:50:46Z")

</div>

Hi @The-Big-K

> [@The-Big-K](#):
>
> Since deleting the engine won't delete the documents

Deleting the engine should the documents.

> [@The-Big-K](#):
>
> PS: Also want to know if the self-hosted app-search is limited to indexing 100,000 documents?

No, there is no limit like that. I just did a bit testing and noticed the document count shown in the dashboard can get out of sync but once a new document is added or removed this count should be fixed.

---

<div class="post-metadata">

**Author:** ![The-Big-K](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the-big-k/32/56199_2.png) [@The-Big-K](https://discuss.elastic.co/u/The-Big-K)\
**Post date:** [January 8, 2020, 6:53am UTC](https://discuss.elastic.co/t/document-deletion-is-painfully-slow-with-self-hosted-app-search/212914/3 "2020-01-08T06:53:26Z")

</div>

@orhantoy- the document count isn't updating even after adding / deleting document and is far lesser than the actual number of documents indexed.

PS: Could this be because of misconfigured filebeat? I've created another discussion: [Unable to view Analytics and API Logs : Is Filebeat running well?](https://discuss.elastic.co/t/unable-to-view-analytics-and-api-logs-is-filebeat-running-well/214075)

---

<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:** [February 5, 2020, 6:57am UTC](https://discuss.elastic.co/t/document-deletion-is-painfully-slow-with-self-hosted-app-search/212914/4 "2020-02-05T06:57:07Z")

</div>

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