Closed
Description
Elasticsearch 2.2.0.
Combination of def
keyword and closure gives the exception.
This gives java.lang.NoClassDefFoundError: groovy/lang/Reference:
GET index/_search
{
"script_fields": {
"test_script": {
"script": {
"inline": "def val = \"\"; p.each{ val += it }; val",
"params": {
"p":["aaa", "bbb", "ccc"]
}
}
}
}
}
This is fine:
GET index/_search
{
"script_fields": {
"test_script": {
"script": {
"inline": "val = \"\"; p.each{ val += it }; val",
"params": {
"p":["aaa", "bbb", "ccc"]
}
}
}
}
}
Adding permission org.elasticsearch.script.ClassPermission "groovy.lang.Reference"
in modules/lang-groovy/plugin-security.policy
seems to fix the issue.