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>