# Update mapping - what is safe to ignore?

**URL:** <https://discuss.elastic.co/t/update-mapping-what-is-safe-to-ignore/4928>\
**Category:** Elasticsearch\
**Created:** [July 22, 2011, 1:06pm UTC](https://discuss.elastic.co/t/update-mapping-what-is-safe-to-ignore/4928 "2011-07-22T13:06:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 22, 2011, 1:06pm UTC](https://discuss.elastic.co/t/update-mapping-what-is-safe-to-ignore/4928/1 "2011-07-22T13:06:48Z")

</div>

Using ES 0.16.2

Due to a change in the source content that I am indexing, I need to update a  
field from a long to string.

The original mapping is dynamic, no explicit mapping was ever provided:  
"event": {  
"dynamic": "true",  
"event\_id": { "type": "long" },  
// other fields ...  
}

The field is never used and I do not care of "legacy" documents having the  
correct type. Looking to change this value to a simple not\_analyzed string:  
"event\_id": { "type": "string", "index": "not\_analyzed" }

Of course, an update mapping between types does not work:  
{"error":"MergeMappingException[Merge failed with failures {[mapper  
[event.event\_id] of different type, current\_type [long], merged\_type  
[string]]}]","status":400}

At this point I set ignore\_conflicts=true and executed the update mapping  
(via curl). I received an acknowledgment, but the mapping is not executed.  
{"ok":true,"acknowledged":true}

No errors appear in the log. I used used (abused?) ignore\_conflicts in the  
past with success, but I am not surprised it does not work in every case.  
What are the cases were an update to a mapping simply is not possible?

My next question is for reindexing recipes, but that is for a different  
thread.

Cheers,

Ivan

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [July 22, 2011, 2:33pm UTC](https://discuss.elastic.co/t/update-mapping-what-is-safe-to-ignore/4928/2 "2011-07-22T14:33:58Z")

</div>

updates to the mapping in your case will cause a lot of trouble.  
change the mapping and create a new index. then reindex and switch the  
alias and optionally delete the old index.

Otherwise strange things can happen ...

On 22 Jul., 15:06, Ivan Brusic [i...@brusic.com](mailto:i...@brusic.com) wrote:

> Using ES 0.16.2
> 
> Due to a change in the source content that I am indexing, I need to update a  
> field from a long to string.
> 
> The original mapping is dynamic, no explicit mapping was ever provided:  
> "event": {  
> "dynamic": "true",  
> "event\_id": { "type": "long" },  
> // other fields ...
> 
> }
> 
> The field is never used and I do not care of "legacy" documents having the  
> correct type. Looking to change this value to a simple not\_analyzed string:  
> "event\_id": { "type": "string", "index": "not\_analyzed" }
> 
> Of course, an update mapping between types does not work:  
> {"error":"MergeMappingException[Merge failed with failures {[mapper
> 
> [event.event\_id] of different type, current\_type [long], merged\_type  
> [string]]}]","status":400}
> 
> At this point I set ignore\_conflicts=true and executed the update mapping  
> (via curl). I received an acknowledgment, but the mapping is not executed.  
> {"ok":true,"acknowledged":true}
> 
> No errors appear in the log. I used used (abused?) ignore\_conflicts in the  
> past with success, but I am not surprised it does not work in every case.  
> What are the cases were an update to a mapping simply is not possible?
> 
> My next question is for reindexing recipes, but that is for a different  
> thread.
> 
> Cheers,
> 
> Ivan

---

<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:** [July 24, 2011, 2:16am UTC](https://discuss.elastic.co/t/update-mapping-what-is-safe-to-ignore/4928/3 "2011-07-24T02:16:00Z")

</div>

You can't change the type of a field mapped, even when ignore\_conflicts is  
set to true. Ignore conflicts simply does that, ignore the conflicts and  
applies what it can, it does not apply conflicts.

On Fri, Jul 22, 2011 at 4:06 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> Using ES 0.16.2
> 
> Due to a change in the source content that I am indexing, I need to update  
> a field from a long to string.
> 
> The original mapping is dynamic, no explicit mapping was ever provided:  
> "event": {  
> "dynamic": "true",  
> "event\_id": { "type": "long" },  
> // other fields ...  
> }
> 
> The field is never used and I do not care of "legacy" documents having the  
> correct type. Looking to change this value to a simple not\_analyzed string:  
> "event\_id": { "type": "string", "index": "not\_analyzed" }
> 
> Of course, an update mapping between types does not work:  
> {"error":"MergeMappingException[Merge failed with failures {[mapper
> 
> [event.event\_id] of different type, current\_type [long], merged\_type  
> [string]]}]","status":400}
> 
> At this point I set ignore\_conflicts=true and executed the update mapping  
> (via curl). I received an acknowledgment, but the mapping is not executed.  
> {"ok":true,"acknowledged":true}
> 
> No errors appear in the log. I used used (abused?) ignore\_conflicts in the  
> past with success, but I am not surprised it does not work in every case.  
> What are the cases were an update to a mapping simply is not possible?
> 
> My next question is for reindexing recipes, but that is for a different  
> thread.
> 
> Cheers,
> 
> Ivan

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 25, 2011, 9:48pm UTC](https://discuss.elastic.co/t/update-mapping-what-is-safe-to-ignore/4928/4 "2011-07-25T21:48:38Z")

</div>

I guess the question I really meant to ask is what updates are/are-not  
possible? Change of type is not permitted. What else?

On Sat, Jul 23, 2011 at 10:16 PM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> You can't change the type of a field mapped, even when ignore\_conflicts is  
> set to true. Ignore conflicts simply does that, ignore the conflicts and  
> applies what it can, it does not apply conflicts.
> 
> On Fri, Jul 22, 2011 at 4:06 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> 
> > Using ES 0.16.2
> > 
> > Due to a change in the source content that I am indexing, I need to update  
> > a field from a long to string.
> > 
> > The original mapping is dynamic, no explicit mapping was ever provided:  
> > "event": {  
> > "dynamic": "true",  
> > "event\_id": { "type": "long" },  
> > // other fields ...  
> > }
> > 
> > The field is never used and I do not care of "legacy" documents having the  
> > correct type. Looking to change this value to a simple not\_analyzed string:  
> > "event\_id": { "type": "string", "index": "not\_analyzed" }
> > 
> > Of course, an update mapping between types does not work:  
> > {"error":"MergeMappingException[Merge failed with failures {[mapper
> > 
> > [event.event\_id] of different type, current\_type [long], merged\_type  
> > [string]]}]","status":400}
> > 
> > At this point I set ignore\_conflicts=true and executed the update mapping  
> > (via curl). I received an acknowledgment, but the mapping is not executed.  
> > {"ok":true,"acknowledged":true}
> > 
> > No errors appear in the log. I used used (abused?) ignore\_conflicts in the  
> > past with success, but I am not surprised it does not work in every case.  
> > What are the cases were an update to a mapping simply is not possible?
> > 
> > My next question is for reindexing recipes, but that is for a different  
> > thread.
> > 
> > Cheers,
> > 
> > Ivan

---

<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:** [July 26, 2011, 4:55am UTC](https://discuss.elastic.co/t/update-mapping-what-is-safe-to-ignore/4928/5 "2011-07-26T04:55:19Z")

</div>

Yea, this needs to be documented, open an issue, I'll doc it.

On Tue, Jul 26, 2011 at 12:48 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> I guess the question I really meant to ask is what updates are/are-not  
> possible? Change of type is not permitted. What else?
> 
> On Sat, Jul 23, 2011 at 10:16 PM, Shay Banon \<[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> 
> > wrote:
> 
> > You can't change the type of a field mapped, even when ignore\_conflicts is  
> > set to true. Ignore conflicts simply does that, ignore the conflicts and  
> > applies what it can, it does not apply conflicts.
> > 
> > On Fri, Jul 22, 2011 at 4:06 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> > 
> > > Using ES 0.16.2
> > > 
> > > Due to a change in the source content that I am indexing, I need to  
> > > update a field from a long to string.
> > > 
> > > The original mapping is dynamic, no explicit mapping was ever provided:  
> > > "event": {  
> > > "dynamic": "true",  
> > > "event\_id": { "type": "long" },  
> > > // other fields ...  
> > > }
> > > 
> > > The field is never used and I do not care of "legacy" documents having  
> > > the correct type. Looking to change this value to a simple not\_analyzed  
> > > string:  
> > > "event\_id": { "type": "string", "index": "not\_analyzed" }
> > > 
> > > Of course, an update mapping between types does not work:  
> > > {"error":"MergeMappingException[Merge failed with failures {[mapper
> > > 
> > > [event.event\_id] of different type, current\_type [long], merged\_type  
> > > [string]]}]","status":400}
> > > 
> > > At this point I set ignore\_conflicts=true and executed the update mapping  
> > > (via curl). I received an acknowledgment, but the mapping is not executed.  
> > > {"ok":true,"acknowledged":true}
> > > 
> > > No errors appear in the log. I used used (abused?) ignore\_conflicts in  
> > > the past with success, but I am not surprised it does not work in every  
> > > case. What are the cases were an update to a mapping simply is not  
> > > possible?
> > > 
> > > My next question is for reindexing recipes, but that is for a different  
> > > thread.
> > > 
> > > Cheers,
> > > 
> > > Ivan

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 26, 2011, 2:30pm UTC](https://discuss.elastic.co/t/update-mapping-what-is-safe-to-ignore/4928/6 "2011-07-26T14:30:11Z")

</div>

Done: [Document what mapping updates are allowed · Issue #1166 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1166)

Obviously, a very low priority. I can probably get the information myself  
by looking at the source code.

Thanks,

Ivan

On Tue, Jul 26, 2011 at 12:55 AM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Yea, this needs to be documented, open an issue, I'll doc it.
> 
> On Tue, Jul 26, 2011 at 12:48 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> 
> > I guess the question I really meant to ask is what updates are/are-not  
> > possible? Change of type is not permitted. What else?
> > 
> > On Sat, Jul 23, 2011 at 10:16 PM, Shay Banon \<  
> > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)\> wrote:
> > 
> > > You can't change the type of a field mapped, even when ignore\_conflicts  
> > > is set to true. Ignore conflicts simply does that, ignore the conflicts and  
> > > applies what it can, it does not apply conflicts.
> > > 
> > > On Fri, Jul 22, 2011 at 4:06 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> > > 
> > > > Using ES 0.16.2
> > > > 
> > > > Due to a change in the source content that I am indexing, I need to  
> > > > update a field from a long to string.
> > > > 
> > > > The original mapping is dynamic, no explicit mapping was ever provided:  
> > > > "event": {  
> > > > "dynamic": "true",  
> > > > "event\_id": { "type": "long" },  
> > > > // other fields ...  
> > > > }
> > > > 
> > > > The field is never used and I do not care of "legacy" documents having  
> > > > the correct type. Looking to change this value to a simple not\_analyzed  
> > > > string:  
> > > > "event\_id": { "type": "string", "index": "not\_analyzed" }
> > > > 
> > > > Of course, an update mapping between types does not work:  
> > > > {"error":"MergeMappingException[Merge failed with failures {[mapper
> > > > 
> > > > [event.event\_id] of different type, current\_type [long], merged\_type  
> > > > [string]]}]","status":400}
> > > > 
> > > > At this point I set ignore\_conflicts=true and executed the update  
> > > > mapping (via curl). I received an acknowledgment, but the mapping is not  
> > > > executed.  
> > > > {"ok":true,"acknowledged":true}
> > > > 
> > > > No errors appear in the log. I used used (abused?) ignore\_conflicts in  
> > > > the past with success, but I am not surprised it does not work in every  
> > > > case. What are the cases were an update to a mapping simply is not  
> > > > possible?
> > > > 
> > > > My next question is for reindexing recipes, but that is for a different  
> > > > thread.
> > > > 
> > > > Cheers,
> > > > 
> > > > Ivan

---

<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:59am UTC](https://discuss.elastic.co/t/update-mapping-what-is-safe-to-ignore/4928/7 "2017-07-06T03:59:18Z")

</div>


