title: Elasticsearch Search Down - SearchPhaseExecutionException
body: <p>My server was running fine until I start getting this error for search queries:</p>
  
  <pre><code>RequestError: TransportError(400, u'SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures 
  
  {[bgh1FwvvTmydjtDhY-reCA][article-index][3]: 
  SearchParseException[[article-index][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query": {"custom_score": {"query": {"query_string": {"query": "Arvi", "fields": ["text", "title^3", "domain"]}}, "script": "_score * (1.000008**(doc[\'articleid\'].value*50000.0/100000.0))"}}}]]]; nested: QueryParsingException[[article-index] [custom_score] the script could not be loaded]; nested: ScriptException[dynamic scripting disabled]; }
  
  {[bgh1FwvvTmydjtDhY-reCA][article-index][4]: SearchParseException[[article-index][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query": {"custom_score": {"query": {"query_string": {"query": "Arvi", "fields": ["text", "title^3", "domain"]}}, "script": "_score * (1.000008**(doc[\'articleid\'].value*50000.0/100000.0))"}}}]]]; nested: QueryParsingException[[article-index] [custom_score] the script could not be loaded]; nested: ScriptException[dynamic scripting disabled]; }
  
  {[bgh1FwvvTmydjtDhY-reCA][article-index][1]: SearchParseException[[article-index][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query": {"custom_score": {"query": {"query_string": {"query": "Arvi", "fields": ["text", "title^3", "domain"]}}, "script": "_score * (1.000008**(doc[\'articleid\'].value*50000.0/100000.0))"}}}]]]; nested: QueryParsingException[[article-index] [custom_score] the script could not be loaded]; nested: ScriptException[dynamic scripting disabled]; }
  
  {[bgh1FwvvTmydjtDhY-reCA][article-index][2]: SearchParseException[[article-index][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query": {"custom_score": {"query": {"query_string": {"query": "Arvi", "fields": ["text", "title^3", "domain"]}}, "script": "_score * (1.000008**(doc[\'articleid\'].value*50000.0/100000.0))"}}}]]]; nested: QueryParsingException[[article-index] [custom_score] the script could not be loaded]; nested: ScriptException[dynamic scripting disabled]; }]'
  )
  </code></pre>
  
  <p>I do not understand what has been changed.
  Using pyelasticsearch, this is the query being pushed</p>
  
  <pre><code>    bodyquery = {
  
          "custom_score": {
              "script" : "_score * ("+str(1.0+recency)+"**(doc['articleid'].value*50000.0/"+maxarticleid+"))",
              "query": {
                      "query_string": {"query": keywordstr, "fields": ["text", "title^3", "domain"]}
              }
          }
      }
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Enabled dynaic scripting and its working. Why was it working earlier, and suddenly it stopped.
  <a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html" rel="nofollow">http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html</a></p>