When I use an mvel script on a field I've mapped as byte, I get an error,
below.
When I changed my mvel script from
doc['age'].value>param3 ? .....
to
doc['age'].doubleValue>param3 ? .....
The error went away.
Questions:
- Can I tweak my mvel script so that I don't need to convert from byte?
Should I convert my parameter to byte? If so, how/where? - What is the best practice here?
The error:
[2012-11-30 11:37:11,093][DEBUG][action.search.type ] [Algrim the
Strong] [haw_index][2], node[Dz4WxCv0TdKyZiodaEepRg], [P], s[STARTED]:
Failed to execute [org.elasticsearch.action.search.SearchRequest@1599f755]
org.elasticsearch.search.query.QueryPhaseExecutionException:
[haw_index][2]: ..... .....: Query Failed [Failed to
execute main query]
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:198)
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:204)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: [Error: internal error: 113]
[Near : {... doc['age'].value>param3 ? pow( ....}]
^
[Line: 1, Column: 1]
at
org.elasticsearch.common.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:439)
at
org.elasticsearch.common.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:142)
at
org.elasticsearch.common.mvel2.optimizers.dynamic.DynamicOptimizer.optimizeAccessor(DynamicOptimizer.java:67)
at org.elasticsearch.common.mvel2.ast.ASTNode.optimize(ASTNode.java:157)
at
org.elasticsearch.common.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:113)
at
org.elasticsearch.common.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:116)
at org.elasticsearch.common.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at
org.elasticsearch.common.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:123)
at
org.elasticsearch.common.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:116)
at
org.elasticsearch.script.mvel.MvelScriptEngineService$MvelSearchScript.run(MvelScriptEngineService.java:192)
at
org.elasticsearch.script.mvel.MvelScriptEngineService$MvelSearchScript.runAsFloat(MvelScriptEngineService.java:197)
at
org.elasticsearch.index.query.CustomScoreQueryParser$ScriptScoreFunction.factor(CustomScoreQueryParser.java:129)
at
org.elasticsearch.common.lucene.search.function.FiltersFunctionScoreQuery$CustomBoostFactorScorer.score(FiltersFunctionScoreQuery.java:314)
at
org.apache.lucene.search.TopScoreDocCollector$InOrderTopScoreDocCollector.collect(TopScoreDocCollector.java:47)
at org.apache.lucene.search.Scorer.score(Scorer.java:90)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:581)
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:194)
... 9 more
Caused by: java.lang.RuntimeException: internal error: 113
at
org.elasticsearch.common.mvel2.math.MathProcessor.toType(MathProcessor.java:139)
at
org.elasticsearch.common.mvel2.math.MathProcessor.doPrimWrapperArithmetic(MathProcessor.java:90)
at
org.elasticsearch.common.mvel2.math.MathProcessor._doOperations(MathProcessor.java:214)
at
org.elasticsearch.common.mvel2.math.MathProcessor.doOperations(MathProcessor.java:78)
at
org.elasticsearch.common.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:116)
at
org.elasticsearch.common.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:38)
at
org.elasticsearch.common.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:959)
at
org.elasticsearch.common.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:343)
... 30 more
--