# Delete type in index using java api

**URL:** <https://discuss.elastic.co/t/delete-type-in-index-using-java-api/91936>\
**Category:** Elasticsearch\
**Created:** [July 5, 2017, 3:00pm UTC](https://discuss.elastic.co/t/delete-type-in-index-using-java-api/91936 "2017-07-05T15:00:54Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [July 5, 2017, 9:18pm UTC](https://discuss.elastic.co/t/delete-type-in-index-using-java-api/91936/4 "2017-07-05T21:18:14Z")

</div>

DeleteByQuery was a plugin before 5.0.  
So you probably need to add it to the transport client as well if you want to use it.

May be read as well:

> [@Deleteing data results related to a query using Java API](https://discuss.elastic.co/t/deleteing-data-results-related-to-a-query-using-java-api/56466):
>
> I am trying to delete certain data according to a search result. I am using elasticsearch version 2.3 with an embedded server. I've managed to do this with the delete-by-query plugin with the standalone server as follows but it seems that we can't use plugins with the embedded server. DeleteByQueryResponse delete = new DeleteByQueryRequestBuilder(client, DeleteByQueryAction.INSTANCE) .setIndices(ES\_INDEX\_NAME) .setTypes(ES\_RECORD\_TYPE) .setQuery(QueryBuilders.boolQuery()…

---

_[View the full topic](https://discuss.elastic.co/t/delete-type-in-index-using-java-api/91936)._
