# Trouble with Delete Mapping

**URL:** <https://discuss.elastic.co/t/trouble-with-delete-mapping/4344>\
**Category:** Elasticsearch\
**Created:** [May 4, 2011, 2:34pm UTC](https://discuss.elastic.co/t/trouble-with-delete-mapping/4344 "2011-05-04T14:34:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sorostaran](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Sorostaran](https://discuss.elastic.co/u/Sorostaran)\
**Post date:** [May 4, 2011, 2:34pm UTC](https://discuss.elastic.co/t/trouble-with-delete-mapping/4344/1 "2011-05-04T14:34:38Z")

</div>

I am having some trouble with Delete Mapping leaving behind a "ghost" of itself. Here is the scenario:

1. Field affiliate\_network\_id is an unanalyzed string in /dffs/mer type.
2. DELETE /dffs/mer type mapping.
3. Check to confirm that all docs in /dffs/mer are gone.
4. PUT /dffs/mer with field affiliate\_network\_id as an integer.
5. Re-import /dffs/mer data.

Afterwards, when I facet on affiliate\_network\_id, it gives a type mismatch error. We have tried Flush, Clear Cache, Refresh, Optimize after step 2) but none of it can get rid of the mapping "ghost" that the previous incarnation of the mapping left behind. When we create the /dffs/mer mapping in a new index /dffn as /dffn/mer everything works just fine.

Does anybody know how I can fully wipe/change a field in a mapping without leaving behind the mapping "ghost" or wiping out the whole /dffs index? We are currently running 0.15.2.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 4, 2011, 4:35pm UTC](https://discuss.elastic.co/t/trouble-with-delete-mapping/4344/2 "2011-05-04T16:35:52Z")

</div>

Can you gist a recreation? In general, delete mapping uses also delete by query to delete all the docs matching that mapping, and in most times, it makes more sense to index data into a new index.  
On Wednesday, May 4, 2011 at 5:34 PM, Sorostaran wrote:

> I am having some trouble with Delete Mapping leaving behind a "ghost" of  
> itself. Here is the scenario:
> 
> 1. Field affiliate\_network\_id is an unanalyzed string in /dffs/mer type.
> 2. DELETE /dffs/mer type mapping.
> 3. Check to confirm that all docs in /dffs/mer are gone.
> 4. PUT /dffs/mer with field affiliate\_network\_id as an integer.
> 5. Re-import /dffs/mer data.
> 
> Afterwards, when I facet on affiliate\_network\_id, it gives a type mismatch  
> error. We have tried Flush, Clear Cache, Refresh, Optimize after step 2) but  
> none of it can get rid of the mapping "ghost" that the previous incarnation  
> of the mapping left behind. When we create the /dffs/mer mapping in a new  
> index /dffn as /dffn/mer everything works just fine.
> 
> Does anybody know how I can fully wipe/change a field in a mapping without  
> leaving behind the mapping "ghost" or wiping out the whole /dffs index? We  
> are currently running 0.15.2.
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Trouble-with-Delete-Mapping-tp2899088p2899088.html](http://elasticsearch-users.115913.n3.nabble.com/Trouble-with-Delete-Mapping-tp2899088p2899088.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<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, 4:06am UTC](https://discuss.elastic.co/t/trouble-with-delete-mapping/4344/3 "2017-07-06T04:06:57Z")

</div>


