# Delete all the documents in the specified index using java

**URL:** <https://discuss.elastic.co/t/delete-all-the-documents-in-the-specified-index-using-java/199756>\
**Category:** Elasticsearch\
**Created:** [September 17, 2019, 5:25am UTC](https://discuss.elastic.co/t/delete-all-the-documents-in-the-specified-index-using-java/199756 "2019-09-17T05:25:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Velliyangiri](https://avatars.discourse-cdn.com/v4/letter/v/50afbb/32.png) [@Velliyangiri](https://discuss.elastic.co/u/Velliyangiri)\
**Post date:** [September 17, 2019, 5:25am UTC](https://discuss.elastic.co/t/delete-all-the-documents-in-the-specified-index-using-java/199756/1 "2019-09-17T05:25:37Z")

</div>

RestHighLevelClient to delete all the documents in the specified index..How is it possible ?and give me the exact solution .

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 17, 2019, 5:45am UTC](https://discuss.elastic.co/t/delete-all-the-documents-in-the-specified-index-using-java/199756/2 "2019-09-17T05:45:37Z")

</div>

This is a forum manned by volunteers so there are no SLAs or guarantees of a response. Just demanding a solution like that might put some people off and make it less likely that you get a response. Also do not open multiple threads about the same thing.

I would recommend you read the documentation around the [high-level REST client delete by query API](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/java-rest-high-document-delete-by-query.html) although it would be more efficient to just delete and recreate the index.

---

<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:** [October 15, 2019, 5:45am UTC](https://discuss.elastic.co/t/delete-all-the-documents-in-the-specified-index-using-java/199756/3 "2019-10-15T05:45:38Z")

</div>

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