# \_id mapping path issues

**URL:** https://discuss.elastic.co/t/-id-mapping-path-issues/20056
**Category:** Elasticsearch
**Created:** [October 2, 2014, 6:26pm UTC](https://discuss.elastic.co/t/-id-mapping-path-issues/20056 "2014-10-02T18:26:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rjb673](https://avatars.discourse-cdn.com/v4/letter/r/3bc359/32.png) [@rjb673](https://discuss.elastic.co/u/rjb673)
#### Post date: [October 2, 2014, 6:26pm UTC](https://discuss.elastic.co/t/-id-mapping-path-issues/20056/1 "2014-10-02T18:26:13Z")

</div>

Hi all,  
I am trying out the \_id mapping path feature, described here:  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-id-field.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-id-field.html)

It works well, though I think I've noticed a limitation (or bug). In my  
project, we allow mappings to be changed over time. The problem I'm seeing  
is that the \_id path doesn't seem to change once it is created. I cannot  
change or remove it. Further, elasticsearch does not return an error when  
I attempt this. A couple of thoughts: (1) if this is a legitimate  
limitation, then please note this on the reference page I mentioned above,  
and (2) when a user attempts this, elastic should return an error (with  
readable description) rather than returning a success code & message. Even  
better would be to enable this feature, and allow the path to be updated.  
Perhaps that's a feature request, not a bug?

I searched the issues on github and in this group, and didn't see this  
limitation mentioned. If anyone could shed some light, please let me  
know. Perhaps I'm not using it correctly.

Here are the steps to demonstrate. I've tried this on 1.3.1 and 1.3.4.

curl -XDELETE localhost:9200/index1

curl -XPUT localhost:9200/index1

curl -XPOST localhost:9200/index1/tweet/\_mapping -d '  
{  
"tweet" : {  
"dynamic": "strict",  
"properties" : {  
"message" : {"type" : "string" }  
},  
"\_id": {  
"path": "post\_id"  
}  
}  
}'

curl -XGET localhost:9200/index1/tweet/\_mapping?pretty

curl -XPOST localhost:9200/index1/tweet/\_mapping -d '  
{  
"tweet" : {  
"dynamic": "strict",  
"properties" : {  
"message" : {"type" : "string" }  
},  
"\_id": {  
"path": "changed"  
}  
}  
}'

curl -XGET localhost:9200/index1/tweet/\_mapping?pretty

The 2nd POST returns _"acknowledged": true_ even though the change of the  
\_id path was not actually effective. You can verify this by observing the  
2nd GET, i.e., it will still return _"path": "post\_id"_ .

Note that the use of "dynamic":"strict" does not seem to change the outcome.

Thanks for your help!  
-Ryan

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9b795608-f1dd-45ab-8177-c9dbb1df200b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9b795608-f1dd-45ab-8177-c9dbb1df200b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:58am UTC](https://discuss.elastic.co/t/-id-mapping-path-issues/20056/2 "2017-07-06T00:58:35Z")

</div>


