0

I'm getting the error nested: ScriptException[dynamic scripting for [groovy] disabled]; because of this aggregation I'm making:

agg :category_aggregation do
  {
    terms: {
      script: "doc['categories.id'].value + '|' + doc['categories.name'].value",
      size: 30
    }
  }
end

I'm using the official elasticsearch gem and also tried with chewy but couldn't find how to enable the dynamic_search anywhere.

ElasticSearch version in my OS X: 1.5.2 installed with homebrew.

1 Answer 1

2

Dynamic scripting can only be enabled from the elasticsearch.yml configuration file in your ES cluster.

Add this to the file on every node and restart your cluster:

script.disable_dynamic: false

UPDATE

Since you've installed ES via homebrew, you can find the elasticsearch.yml file in /usr/local/Cellar/elasticsearch/1.5.2/config

Sign up to request clarification or add additional context in comments.

3 Comments

I've read it before but I couldn't find this file anywhere on my machine and couldn't even find where should I create it with a default content. So I thought that maybe the gem could also have a config file that would overlap the server configuration. Can you tell me where to find this file? Finder didin't find the file. I've installed ES with homebrew.
Yup, the file was right there. Don't know why finder didn't find it. Thanks a lot!
Glad I could help! I don't trust the finder :-) Note that if you run brew info elasticsearch it will tell you where the installation folder is located.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.