Specifying different script.lang causes elastic search to timeout


(davecm) #1

Hi,
When I specify a script language, it causes elasticsearch to time out. I
have tried with lang-python and lang-javascript.
I'm using ElasticSearch 0.90.3, lang-python 1.2.0 and lang-javascript 1.4.0.

When viewing the console ouput, I see the following:
Exception in thread "elasticsearch[alt-cluster_node_search01][search][T#5]"
java.lang.AbstractMethodError:
org.elasticsearch.script.javascript.JavaScriptScriptEngineService$JavaScriptSearchScript.setNextReader(Lorg/apache/lucene/index/IndexReader;)V
at
org.elasticsearch.index.query.CustomScoreQueryParser$ScriptScoreFunction.setNextReader(CustomScoreQueryParser.java:116)
at
org.elasticsearch.common.lucene.search.function.FunctionScoreQuery$CustomBoostFactorWeight.scorer(FunctionScoreQuery.java:106)
at
org.apache.lucene.search.FilteredQuery.getFilteredScorer(FilteredQuery.java:149)
at org.apache.lucene.search.FilteredQuery$1.scorer(FilteredQuery.java:117)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:577)
at
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:195)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:445)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:426)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:342)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:330)
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:178)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:140)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:178)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)

The plugin loads when I start ES.

Any ideas are greatly appreciated. Thanks!
Dave

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(davecm) #2

Also, the query I am using is below. To make things simple, the custom query script simply returns "1".

The query that times out: (lang: 'js' is specified)
{'query': {'custom_score': {'lang': 'js',
'query': {'filtered': {'filter': {'fquery': {'_cache': True,
'query': {'query_string': {'query': u'django_ct:(member.subscriber)'}}}},
'query': {'query_string': {'analyze_wildcard': True,
'auto_generate_phrase_queries': True,
'default_field': 'text',
'default_operator': 'AND',
'query': u'(table)'}}}},
'script': '1'}}}

Same query (without lang: 'js' that works)

{'query': {'custom_score': {'query': {'filtered': {'filter': {'fquery': {'_cache': True,
'query': {'query_string': {'query': u'django_ct:(member.subscriber)'}}}},
'query': {'query_string': {'analyze_wildcard': True,
'auto_generate_phrase_queries': True,
'default_field': 'text',
'default_operator': 'AND',
'query': u'(table)'}}}},
'script': '1'}}}

Dave Brown
Software Engineer

email dave@custommade.com
office (617) 231-6301 ext: 1047

On Sep 12, 2013, at 2:50 PM, Dave Brown dave@custommade.com wrote:

Hi,
When I specify a script language, it causes elasticsearch to time out. I have tried with lang-python and lang-javascript.
I'm using ElasticSearch 0.90.3, lang-python 1.2.0 and lang-javascript 1.4.0.

When viewing the console ouput, I see the following:
Exception in thread "elasticsearch[alt-cluster_node_search01][search][T#5]" java.lang.AbstractMethodError: org.elasticsearch.script.javascript.JavaScriptScriptEngineService$JavaScriptSearchScript.setNextReader(Lorg/apache/lucene/index/IndexReader;)V
at org.elasticsearch.index.query.CustomScoreQueryParser$ScriptScoreFunction.setNextReader(CustomScoreQueryParser.java:116)
at org.elasticsearch.common.lucene.search.function.FunctionScoreQuery$CustomBoostFactorWeight.scorer(FunctionScoreQuery.java:106)
at org.apache.lucene.search.FilteredQuery.getFilteredScorer(FilteredQuery.java:149)
at org.apache.lucene.search.FilteredQuery$1.scorer(FilteredQuery.java:117)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:577)
at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:195)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:445)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:426)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:342)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:330)
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:178)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:140)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:178)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)

The plugin loads when I start ES.

Any ideas are greatly appreciated. Thanks!
Dave

--
You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elasticsearch/KQHhCIgqYew/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Luca Cavanna) #3

Hi Dave,
looks like the elasticsearch jar that is generating the above stacktrace is
not 0.90.3. It seems at least 0.20, as it's pretty clear it refers Lucene
3.x. In fact the setNextReader method accepts now an AtomicReaderContext
instead of IndexReader. The plugin versions you use expose the new version
of the method, while given the stacktrace elasticsearch is looking for the
old one.

Could you please make sure you're running the latest version of
elasticsearch? Or maybe you have collisions in your classpath?

Cheers
Luca

On Thursday, September 12, 2013 9:09:06 PM UTC+2, Dave Brown wrote:

Also, the query I am using is below. To make things simple, the custom
query script simply returns "1".

The query that times out: (lang: 'js' is specified)
{'query': {'custom_score': {'lang': 'js',
'query': {'filtered': {'filter': {'fquery': {'_cache': True,
'query': {'query_string': {'query':
u'django_ct:(member.subscriber)'}}}},
'query': {'query_string': {'analyze_wildcard': True,
'auto_generate_phrase_queries': True,
'default_field': 'text',
'default_operator': 'AND',
'query': u'(table)'}}}},
'script': '1'}}}

Same query (without lang: 'js' that works)

{'query': {'custom_score': {'query': {'filtered': {'filter': {'fquery':
{'_cache': True,
'query': {'query_string': {'query':
u'django_ct:(member.subscriber)'}}}},
'query': {'query_string': {'analyze_wildcard': True,
'auto_generate_phrase_queries': True,
'default_field': 'text',
'default_operator': 'AND',
'query': u'(table)'}}}},
'script': '1'}}}

Dave Brown
Software Engineer

email da...@custommade.com <javascript:>
office (617) 231-6301 ext: 1047

On Sep 12, 2013, at 2:50 PM, Dave Brown <da...@custommade.com<javascript:>>
wrote:

Hi,
When I specify a script language, it causes elasticsearch to time out. I
have tried with lang-python and lang-javascript.
I'm using ElasticSearch 0.90.3, lang-python 1.2.0 and lang-javascript
1.4.0.

When viewing the console ouput, I see the following:
Exception in thread
"elasticsearch[alt-cluster_node_search01][search][T#5]"
java.lang.AbstractMethodError:
org.elasticsearch.script.javascript.JavaScriptScriptEngineService$JavaScriptSearchScript.setNextReader(Lorg/apache/lucene/index/IndexReader;)V
at
org.elasticsearch.index.query.CustomScoreQueryParser$ScriptScoreFunction.setNextReader(CustomScoreQueryParser.java:116)
at
org.elasticsearch.common.lucene.search.function.FunctionScoreQuery$CustomBoostFactorWeight.scorer(FunctionScoreQuery.java:106)
at
org.apache.lucene.search.FilteredQuery.getFilteredScorer(FilteredQuery.java:149)
at org.apache.lucene.search.FilteredQuery$1.scorer(FilteredQuery.java:117)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:577)
at
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:195)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:445)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:426)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:342)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:330)
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:178)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:140)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:178)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)

The plugin loads when I start ES.

Any ideas are greatly appreciated. Thanks!
Dave

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/KQHhCIgqYew/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(davecm) #4

That was it! Thanks so much!

Dave Brown
Software Engineer

email dave@custommade.com
office (617) 231-6301 ext: 1047

On Sep 12, 2013, at 3:41 PM, Luca Cavanna cavannaluca@gmail.com wrote:

Hi Dave,
looks like the elasticsearch jar that is generating the above stacktrace is not 0.90.3. It seems at least 0.20, as it's pretty clear it refers Lucene 3.x. In fact the setNextReader method accepts now an AtomicReaderContext instead of IndexReader. The plugin versions you use expose the new version of the method, while given the stacktrace elasticsearch is looking for the old one.

Could you please make sure you're running the latest version of elasticsearch? Or maybe you have collisions in your classpath?

Cheers
Luca

On Thursday, September 12, 2013 9:09:06 PM UTC+2, Dave Brown wrote:
Also, the query I am using is below. To make things simple, the custom query script simply returns "1".

The query that times out: (lang: 'js' is specified)
{'query': {'custom_score': {'lang': 'js',
'query': {'filtered': {'filter': {'fquery': {'_cache': True,
'query': {'query_string': {'query': u'django_ct:(member.subscriber)'}}}},
'query': {'query_string': {'analyze_wildcard': True,
'auto_generate_phrase_queries': True,
'default_field': 'text',
'default_operator': 'AND',
'query': u'(table)'}}}},
'script': '1'}}}

Same query (without lang: 'js' that works)

{'query': {'custom_score': {'query': {'filtered': {'filter': {'fquery': {'_cache': True,
'query': {'query_string': {'query': u'django_ct:(member.subscriber)'}}}},
'query': {'query_string': {'analyze_wildcard': True,
'auto_generate_phrase_queries': True,
'default_field': 'text',
'default_operator': 'AND',
'query': u'(table)'}}}},
'script': '1'}}}

Dave Brown
Software Engineer

email da...@custommade.com
office (617) 231-6301 ext: 1047

On Sep 12, 2013, at 2:50 PM, Dave Brown da...@custommade.com wrote:

Hi,
When I specify a script language, it causes elasticsearch to time out. I have tried with lang-python and lang-javascript.
I'm using ElasticSearch 0.90.3, lang-python 1.2.0 and lang-javascript 1.4.0.

When viewing the console ouput, I see the following:
Exception in thread "elasticsearch[alt-cluster_node_search01][search][T#5]" java.lang.AbstractMethodError: org.elasticsearch.script.javascript.JavaScriptScriptEngineService$JavaScriptSearchScript.setNextReader(Lorg/apache/lucene/index/IndexReader;)V
at org.elasticsearch.index.query.CustomScoreQueryParser$ScriptScoreFunction.setNextReader(CustomScoreQueryParser.java:116)
at org.elasticsearch.common.lucene.search.function.FunctionScoreQuery$CustomBoostFactorWeight.scorer(FunctionScoreQuery.java:106)
at org.apache.lucene.search.FilteredQuery.getFilteredScorer(FilteredQuery.java:149)
at org.apache.lucene.search.FilteredQuery$1.scorer(FilteredQuery.java:117)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:577)
at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:195)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:445)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:426)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:342)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:330)
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:178)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:140)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:178)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)

The plugin loads when I start ES.

Any ideas are greatly appreciated. Thanks!
Dave

--
You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elasticsearch/KQHhCIgqYew/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elasticsearch/KQHhCIgqYew/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #5