scripts of type [inline], operation [update] and lang [groovy] are disabled

1.4k Views Asked by At

We have elasticSearch version 2.4.0. I have updated elasticsearch.yml with the following values:

script.inline: true
script.indexed: true
script.update: true
script.mapping: true
script.engine.groovy.file.aggs: true
script.engine.groovy.file.mapping: true
script.engine.groovy.file.search: true
script.engine.groovy.file.update: true
script.engine.groovy.file.plugin: true
script.engine.groovy.indexed.aggs: true
script.engine.groovy.indexed.mapping: true
script.engine.groovy.indexed.search: true
script.engine.groovy.indexed.update: true
script.engine.groovy.indexed.plugin: true
script.engine.groovy.inline.aggs: true
script.engine.groovy.inline.mapping: true
script.engine.groovy.inline.search: true
script.engine.groovy.inline.update: true
script.engine.groovy.inline.plugin: true

I am using _update_by_query API with the following example payload:

{
  "script":{
  "inline": "ctx._source.myVariable = ctx._source.id == params.newVal ? 'test':ctx._source.myVariable ",
  "params": {
      "newVal": "2c9ef"
    }}
}

I am still getting the following error response:

{
    "error": {
        "root_cause": [
            {
                "type": "script_exception",
                "reason": "scripts of type [inline], operation [update] and lang [groovy] are disabled"
            }
        ],
        "type": "script_exception",
        "reason": "scripts of type [inline], operation [update] and lang [groovy] are disabled"
    },
    "status": 500
}

I have taken config details from here.

1

There are 1 best solutions below

0
MrMartin On

You must restart your ES instance for these changes to take effect