Could anyone with more knowledge of painless could help me with a problem I have right now:
After upgrading Stack to 7.2, in one of the visualization that is using Scripted field, I get shards failed error, it used to work before upgrade.
the painless code that used to work in 6.5:
if (!doc.containsKey('data.AudioPath.keyword') || doc['data.AudioPath.keyword'].value == null){ return ""; } return "https://xxx/" + doc['data.AudioPath.keyword'].value;
and verified that data is correctly passed as type String:
"_source" : {
"data" : {
...
"AudioPath" : "08035264-9d60-11e9-a23a-8c0f6f7c1ae2.wav"
},
Here's the message in POST response:
script_stack: ["org.elasticsearch.index.fielddata.ScriptDocValues$Strings.get(ScriptDocValues.java:496)",…]
2: "if (!doc.containsKey('data.AudioPath.keyword') || doc['data.AudioPath.keyword'].value == null){ "
3: " ^---- HERE"
and also:
caused_by: {type: "illegal_state_exception",…}
reason: "A document doesn't have a value for a field! Use doc[<field>].size()==0 to check if a document is missing a field!"
I went through documentation before upgrade and nowhere I found any statement of breaking changes in Painless Language...