# MergeMappingException from string to multifield

**URL:** <https://discuss.elastic.co/t/mergemappingexception-from-string-to-multifield/12423>\
**Category:** Elasticsearch\
**Created:** [June 14, 2013, 7:08pm UTC](https://discuss.elastic.co/t/mergemappingexception-from-string-to-multifield/12423 "2013-06-14T19:08:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emily\_Wu](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@Emily\_Wu](https://discuss.elastic.co/u/Emily_Wu)\
**Post date:** [June 14, 2013, 7:08pm UTC](https://discuss.elastic.co/t/mergemappingexception-from-string-to-multifield/12423/1 "2013-06-14T19:08:17Z")

</div>

From what I understand, I should be able to change a mapping from a string  
to a multifield without conflict, but when I attempt to, I get a  
MergeMappingException:  
{  
"error" : "MergeMappingException[Merge failed with failures {[mapper  
[tags] of different type, current\_type [string], merged\_type  
[MultiFieldMapper], mapper [tags.breakdown] of different type, current\_type  
[string], merged\_type [MultiFieldMapper], mapper [tags.partial] of  
different type, current\_type [string], merged\_type [MultiFieldMapper]]}]",  
"status" : 400  
}

Here's the existing mapping:

{  
"items" : {  
"properties" : {  
"name" : {  
"type" : "string"  
},  
"tags" : {  
"type" : "multi\_field",  
"fields" : {  
"tags" : {  
"type" : "string",  
"analyzer" : "tag\_analyzer"  
},  
"breakdown" : {  
"type" : "string",  
"analyzer" : "breakdown\_tag\_analyzer",  
"include\_in\_all" : false  
},  
"partial" : {  
"type" : "string",  
"index\_analyzer" : "partial\_tag\_analyzer",  
"search\_analyzer" : "tag\_analyzer",  
"include\_in\_all" : false  
}  
}  
}  
}  
}  
}

And here's how I'd like to update it:

{  
"items" : {  
"properties" : {  
"tags" : {  
"type" : "multi\_field",  
"fields" : {  
"tags" : {  
"type" : "multi\_field",  
"path" : "just\_name",  
"fields" : {  
"tags" : {"type" : "string", "analyzer" : "tag\_analyzer"},  
"tags\_all" : {"type" : "string", "analyzer" : "tag\_analyzer"}  
},  
"boost" : 1.0  
},  
"breakdown" : {  
"type" : "multi\_field",  
"path" : "just\_name",  
"fields" : {  
"breakdown" : {"type" : "string", "analyzer" :  
"breakdown\_tag\_analyzer"},  
"tags\_all" : {"type" : "string", "analyzer" :  
"breakdown\_tag\_analyzer"}  
},  
"boost" : 0.8  
},  
"partial" : {  
"type" : "multi\_field",  
"path" : "just\_name",  
"fields" : {  
"partial" : {  
"type" : "string",  
"index\_analyzer" : "partial\_tag\_analyzer",  
"search\_analyzer" : "tag\_analyzer"  
},  
"tags\_all" : {  
"type" : "string",  
"index\_analyzer" : "partial\_tag\_analyzer",  
"search\_analyzer" : "tag\_analyzer"  
}  
}  
}  
}  
}  
}  
}  
}

Any idea why I'm getting the error or how to get around it? I'm working  
with a finicky river to get this data, so I'd like to avoid having to  
delete it and the index and set everything up again. (Even them, I'm not  
sure I would be able to, as the river would create the mapping on its own,  
and I'd end up with the same conflict again.)

Thanks,  
Emily.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:31am UTC](https://discuss.elastic.co/t/mergemappingexception-from-string-to-multifield/12423/2 "2017-07-06T02:31:10Z")

</div>


