Cannot convert MethodHandle(List,int)int to (Object,String)String

I'm using _update_by_query with script which contains many if's like this:

ArrayList tmp=[];
if(ctx._source.anketa["REGION"]==3){tmp.add(2);}
if(ctx._source.anketa["REGION"]==4){tmp.add(5);}
if(ctx._source.anketa["REGION"]==5){tmp.add(3);}
 if(ctx._source.anketa["REGION"]==6){tmp.add(7);}
...
ctx._source.anketa["anotherfield"] = tmp;

At some point I get exception:
array (
'type' => 'wrong_method_type_exception',
'reason' => 'cannot convert MethodHandle(List,int)int to (Object,String)String',
),
'script_stack' =>
array (
0 => 'if(ctx._source.anketa["REGION"]==1){',
1 => '.......................^---- HERE',
),

How can I debug which document causes this? I need some instanceof verification I think, but I have very little Java knowledge.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.