You are looking at documentation for an older release.
Not what you want? See the
current release documentation.
Scripting changesedit
Scripting syntaxedit
The syntax for scripts has been made consistent across all APIs. The accepted format is as follows:
- Inline/Dynamic scripts
- Indexed scripts
- File scripts
For example, an update request might look like this:
POST my_index/my_type/1/_update { "script": { "inline": "ctx._source.count += val", "params": { "val": 3 } }, "upsert": { "count": 0 } }
A short syntax exists for running inline scripts in the default scripting language without any parameters:
GET _search { "script_fields": { "concat_fields": { "script": "doc['one'].value + ' ' + doc['two'].value" } } }
Scripting settingsedit
The script.disable_dynamic
node setting has been replaced by fine-grained
script settings described in Scripting settings.
Groovy scripts sandboxedit
The Groovy sandbox and related settings have been removed. Groovy is now a non-sandboxed scripting language, without any option to turn the sandbox on.
Plugins making use of scriptsedit
Plugins that make use of scripts must register their own script context
through ScriptModule
. Script contexts can be used as part of fine-grained
settings to enable/disable scripts selectively.