Did you upgrade to 1.2?  Dynamic scripts are now disabled by default.

https://github.com/elasticsearch/elasticsearch/pull/5943

-- 
Ivan


On Mon, May 26, 2014 at 11:16 PM, Pratik Poddar <[email protected]>wrote:

> My server was running fine until I start getting this error for search
> queries:
>
> 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]; }]' )
>
> I do not understand what has been changed. Using pyelasticsearch, this is
> the query being pushed
>
>     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"]}
>             }
>         }
>     }
>
>  --
> You received this message because you are subscribed to the Google Groups
> "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/66b3ba4f-e062-42b2-a144-956fff13a5b0%40googlegroups.com<https://groups.google.com/d/msgid/elasticsearch/66b3ba4f-e062-42b2-a144-956fff13a5b0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQArnEpL%2Bp6P8E3yx2VZENF%2BQXrXjHJ-fRvvJXA9ndtEeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to