# Problem with updating of an excluded field

**URL:** <https://discuss.elastic.co/t/problem-with-updating-of-an-excluded-field/13000>\
**Category:** Elasticsearch\
**Created:** [July 30, 2013, 9:19am UTC](https://discuss.elastic.co/t/problem-with-updating-of-an-excluded-field/13000 "2013-07-30T09:19:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexey\_F](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@Alexey\_F](https://discuss.elastic.co/u/Alexey_F)\
**Post date:** [July 30, 2013, 9:19am UTC](https://discuss.elastic.co/t/problem-with-updating-of-an-excluded-field/13000/1 "2013-07-30T09:19:06Z")

</div>

Hello all!

I've encountered a problem with updates of an excluded field (0.90.2 Elasticsearch version). For example, I have the following mapping:  
"mappings" : {  
"my\_mapping" : {  
"\_source" : { "excludes" : ["ex\_prop"] },  
"properties" : {  
"ex\_prop" : { "type" : "string", "index" : "analyzed" }  
}  
}  
}

I add a document with keyword "start":  
curl -XPUT localhost:9200/my\_index/my\_mapping/1 -d '{  
"ex\_prop" : " start "  
}'

Then I update the document:  
curl -XPOST 'localhost:9200/my\_index/my\_mapping/1/\_update' -d '{  
"script" : "ctx.\_source.ex\_prop += param\_ex",  
"params" : {  
"param\_ex" : " update "  
}  
}'

Sometimes this update fails with an error:  
{"error":"ElasticSearchIllegalArgumentException[failed to execute script]; nested: PropertyAccessException[[Error: could not access: ex\_prop; in class: java.util.LinkedHashMap]\n[Near : {... ctx.\_source.ex\_prop+param\_ex ....}]\n ^\n[Line: 1, Column: 1]]; ","status":400}

If updating is OK, I search for two keywords: "start" and "update". Elasticsearch never finds any documents with the "start" keyword. "update" is sometimes found, sometimes isn't.

But everything works fine with 0.20.4-3 Elasticsearch version.

Is this a bug, or do I do something wrong?

Here is the script I used for tests: \<nabble\_a href="script.sh"\>script.sh\</nabble\_a\>

---

<div class="post-metadata">

**Author:** ![Alexey\_F](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@Alexey\_F](https://discuss.elastic.co/u/Alexey_F)\
**Post date:** [July 31, 2013, 12:48pm UTC](https://discuss.elastic.co/t/problem-with-updating-of-an-excluded-field/13000/2 "2013-07-31T12:48:33Z")

</div>

Any ideas? I think this problem is critical...

---

<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:23am UTC](https://discuss.elastic.co/t/problem-with-updating-of-an-excluded-field/13000/3 "2017-07-06T02:23:32Z")

</div>


