# Update to a document with strict dynamic mapping index problem

**URL:** <https://discuss.elastic.co/t/update-to-a-document-with-strict-dynamic-mapping-index-problem/44712>\
**Category:** Elasticsearch\
**Created:** [March 17, 2016, 1:27pm UTC](https://discuss.elastic.co/t/update-to-a-document-with-strict-dynamic-mapping-index-problem/44712 "2016-03-17T13:27:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkOStewart](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@MarkOStewart](https://discuss.elastic.co/u/MarkOStewart)\
**Post date:** [March 17, 2016, 1:27pm UTC](https://discuss.elastic.co/t/update-to-a-document-with-strict-dynamic-mapping-index-problem/44712/1 "2016-03-17T13:27:52Z")

</div>

I am trying to update a record as a username was misspelled. I need to do something similar to change Steward to Stewart on a lastname field. I have dynamic = strict and i cannot figure out how to update this lastname record in this document.  
There was another topic from around a year ago that had a similar request but no one answered it.

Hints or ideas would be appreciated.

**The document index**  
GET /purchase\_2016021/\_search?q=sr.mateInfo.last:"Steward"  
{  
"took": 3,  
"timed\_out": false,  
"\_shards": {  
"total": 1,  
"successful": 1,  
"failed": 0  
},  
"hits": {  
"total": 1,  
"max\_score": 10.19355,  
"hits": [  
{  
"\_index": "purchase\_2016021",  
"\_type": "subscriptions",  
"\_id": "13f8b602-ba1e-11e5-b116-0b4ceb2bd39c",  
"\_score": 10.19355,  
"\_source": {  
"sId": "13f8b602-ba1e-11e5-b116-0b4ceb2bd39c",  
"sState": "assigned",  
"sv\_aid": "aid-flo-0a83235e",  
"sType": "dot",  
"sr": {  
"facility": {  
"city": "Dallas",  
"name": "Demo",  
"state": "TX",  
"zip": "75000",  
"id": "demo"  
},  
"planId": "a",  
"jId": 2003,  
"custSite": "demo",  
"sponsorEmail": "uh@huh.net",  
"sponsorFirstName": "foo",  
"sponsorLastName": "Tech",  
"inmateInfo": {  
"first": "Joe",  
"last": "Steward"  
}  
},  
"udate": "2016-01-13T20:45:30Z",  
"cdate": "2016-01-13T17:50:05Z",  
"orderNumber": 13267  
}  
}  
]  
}

**When I try to update the record with:**  
PUT /purchase\_2016021/post/13f8b602-ba1e-11e5-b116-0b4ceb2bd39c  
{  
"sId": "13f8b602-ba1e-11e5-b116-0b4ceb2bd39c",  
"sState": "assigned",  
"sv\_aid": "aid-flo-0a83235e",  
"sType": "dot",  
"sr": {  
"facility": {  
"city": "Dallas",  
"name": "Demo",  
"state": "TX",  
"zip": "75000",  
"id": "demo"  
},  
"planId": "a",  
"jId": 2003,  
"custSite": "demo",  
"sponsorEmail": "uh@huh.net",  
"sponsorFirstName": "foo",  
"sponsorLastName": "Tech",  
"inmateInfo": {  
"first": "Joe",  
"last": "Stewart"  
}  
},  
"udate": "2016-01-13T20:45:30Z",  
"cdate": "2016-01-13T17:50:05Z",  
"orderNumber": 13267  
}

**I get the following error:**  
"error": {  
"root\_cause": [  
{  
"type": "strict\_dynamic\_mapping\_exception",  
"reason": "mapping set to strict, dynamic introduction of [sId] within [post] is not allowed"  
}

ANY ideas will be MUCH appreciated.

Thank You in Advance

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 17, 2016, 1:39pm UTC](https://discuss.elastic.co/t/update-to-a-document-with-strict-dynamic-mapping-index-problem/44712/2 "2016-03-17T13:39:38Z")

</div>

Are you sure you have the correct index `_type` of the document addressed?

Try

```auto
PUT /purchase_2016021/subscriptions/13f8b602-ba1e-11e5-b116-0b4ceb2bd39c 
{
"sId": "13f8b602-ba1e-11e5-b116-0b4ceb2bd39c",
...
}

```

---

<div class="post-metadata">

**Author:** ![MarkOStewart](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@MarkOStewart](https://discuss.elastic.co/u/MarkOStewart)\
**Post date:** [March 17, 2016, 7:07pm UTC](https://discuss.elastic.co/t/update-to-a-document-with-strict-dynamic-mapping-index-problem/44712/3 "2016-03-17T19:07:46Z")

</div>

Thank you VERY much that was the piece I needed. I knew I was close but could't seem to find the key.

Again Thank You for the quick reply and correct answer.

Mark

---

<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 5, 2017, 11:07pm UTC](https://discuss.elastic.co/t/update-to-a-document-with-strict-dynamic-mapping-index-problem/44712/4 "2017-07-05T23:07:29Z")

</div>


