-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Closed
Labels
:Core/Infra/ScriptingScripting abstractions, Painless, and MustacheScripting abstractions, Painless, and Mustache>enhancementgood first issuelow hanging fruitlow hanging fruit
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.
Metadata
Metadata
Assignees
Labels
:Core/Infra/ScriptingScripting abstractions, Painless, and MustacheScripting abstractions, Painless, and Mustache>enhancementgood first issuelow hanging fruitlow hanging fruit