# How to delete index Type from index using java api?

**URL:** <https://discuss.elastic.co/t/how-to-delete-index-type-from-index-using-java-api/7461>\
**Category:** Elasticsearch\
**Created:** [April 25, 2012, 8:03am UTC](https://discuss.elastic.co/t/how-to-delete-index-type-from-index-using-java-api/7461 "2012-04-25T08:03:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [April 25, 2012, 8:03am UTC](https://discuss.elastic.co/t/how-to-delete-index-type-from-index-using-java-api/7461/1 "2012-04-25T08:03:21Z")

</div>

Hi

I want to delete index type from index using java.

Thanks

---

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [April 25, 2012, 8:16am UTC](https://discuss.elastic.co/t/how-to-delete-index-type-from-index-using-java-api/7461/2 "2012-04-25T08:16:06Z")

</div>

i got the idea:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

```
    DeleteMappingRequest deleteMapping=new 

```

DeleteMappingRequest(indexName).type(indexType);  
DeleteMappingResponse actionGet =  
client.admin().indices().deleteMapping(type).actionGet();

On Wednesday, April 25, 2012 1:33:21 PM UTC+5:30, sam wrote:

> Hi
> 
> I want to delete index type from index using java.
> 
> Thanks

---

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [April 25, 2012, 10:58am UTC](https://discuss.elastic.co/t/how-to-delete-index-type-from-index-using-java-api/7461/3 "2012-04-25T10:58:19Z")

</div>

after deleting an mapping(type) i have try to create mapping with same  
name(type) with same data,i got an exception and when i go for searching i  
got zero hit. i have include the log details on attachment.please tell me  
where the problem.

Thanks

On Wednesday, April 25, 2012 1:46:06 PM UTC+5:30, sam wrote:

> i got the idea:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-delete-mapping.html)
> 
> ```
> DeleteMappingRequest deleteMapping=new 
> 
> ```
> 
> DeleteMappingRequest(indexName).type(indexType);  
> DeleteMappingResponse actionGet =  
> client.admin().indices().deleteMapping(type).actionGet();
> 
> On Wednesday, April 25, 2012 1:33:21 PM UTC+5:30, sam wrote:
> 
> > Hi
> > 
> > I want to delete index type from index using java.
> > 
> > Thanks

---

<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:** [July 6, 2017, 3:31am UTC](https://discuss.elastic.co/t/how-to-delete-index-type-from-index-using-java-api/7461/4 "2017-07-06T03:31:11Z")

</div>


