title: Elasticsearch Dynamic Scripting Disabled
body: <p>I am trying the following query on aggregation:</p>
  
  <pre><code>aggs:{
      total:{
          sum:{
              script: "doc['comments'].value + doc['likes'].value + doc['shares'].value"
          }   
      }
  }
  </code></pre>
  
  <p>and it throws the following exception:</p>
  
  <p><code>ScriptException[dynamic scripting disabled]</code></p>
  
  <p>Any idea how can I fix this. Refer:</p>
  
  <p><a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-sum-aggregation.html">http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-sum-aggregation.html</a></p>