# Delete by query with an App Search Engine

**URL:** <https://discuss.elastic.co/t/delete-by-query-with-an-app-search-engine/312618>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [August 22, 2022, 12:12pm UTC](https://discuss.elastic.co/t/delete-by-query-with-an-app-search-engine/312618 "2022-08-22T12:12:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Conor\_Hennessy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/conor_hennessy/32/91354_2.png) [@Conor\_Hennessy](https://discuss.elastic.co/u/Conor_Hennessy)\
**Post date:** [August 22, 2022, 12:12pm UTC](https://discuss.elastic.co/t/delete-by-query-with-an-app-search-engine/312618/1 "2022-08-22T12:12:45Z")

</div>

Hi,

We are facing an issue where we have an engine in App Search and we wish to delete up to 10k documents (from a total of 50k+). This is too many documents to (efficiently) delete manually via the [documents api](https://www.elastic.co/guide/en/app-search/current/documents.html#documents-delete).

Can we delete the documents directly from the Elasticsearch index using the [delete by query api](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html) to find all the documents with a certain field value, and delete them?

By deleting documents directly from the index, and not through the API in App Search, would this cause any issue with App search itself? We use the [search](https://www.elastic.co/guide/en/app-search/current/search.html) and [documents](https://www.elastic.co/guide/en/app-search/current/documents.html) APIs, we have some search relevance settings and no curations.

Thank you

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [August 22, 2022, 1:48pm UTC](https://discuss.elastic.co/t/delete-by-query-with-an-app-search-engine/312618/2 "2022-08-22T13:48:10Z")

</div>

Hi @Conor_Hennessy

Unless you are using an Elasticsearch Index based Engine (Tech Preview in 8.3.x, [see here](https://www.elastic.co/guide/en/app-search/current/elasticsearch-engines.html)), we do not recommend using Elasticsearch APIs to manage your App Search Engines.

You should be able to delete 100 documents at a time using the Documents API. You can call that endpoint concurrently with multiple threads in order to more quickly remove your 10k documents.

---

<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:** [September 19, 2022, 1:48pm UTC](https://discuss.elastic.co/t/delete-by-query-with-an-app-search-engine/312618/3 "2022-09-19T13:48:20Z")

</div>

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