Mohitt
Mohitt

Reputation: 2977

Elasticsearch - script_fields error

I am using elastic 1.5.0. When I run this block in the query:

"script_fields" : {
        "test1" : {
            "script" : "doc['actual_air_time'].value * 2",
             "lang":"groovy"
        }
    }

I get an error:

nested: ScriptException[dynamic scripting for [groovy] disabled]

How can I enable groovy script for elastic? Is there any other way to evaluate "test1" without using script_fields?

Upvotes: 0

Views: 143

Answers (1)

Nir Alfasi
Nir Alfasi

Reputation: 53525

You can enable it in elasticsearch.yml, by setting:

script.groovy.sandbox.enabled: true

For more details see: http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html

Upvotes: 1

Related Questions