title: How to enable dynamic scripting in ElasticSearch with its gem?
body: <p>I'm getting the error <code>nested: ScriptException[dynamic scripting for [groovy] disabled];</code> because of this aggregation I'm making:</p>
  
  <pre><code>agg :category_aggregation do
    {
      terms: {
        script: "doc['categories.id'].value + '|' + doc['categories.name'].value",
        size: 30
      }
    }
  end
  </code></pre>
  
  <p>I'm using the official elasticsearch gem and also tried with chewy but couldn't find how to enable the dynamic_search anywhere.</p>
  
  <p>ElasticSearch version in my OS X: 1.5.2 installed with homebrew.</p>