GroovyScriptCompilationException:MultipleCompilationErrorsException启动失败

时间:2015-04-20 12:32:45

标签: elasticsearch

我是弹性搜索新手,最近将运行ES的AWS实例迁移到另一个。 我正面临以下问题 -

Possibly unhandled Error: SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[_8uw3w4VQqux9ako2Yc1kw][twitter-2009][0]: SearchParseException[[twitter-2009][0]: query[(+created_time:[1426809600000 TO 1429488000000] brand_id:taruntahiliani)~1],from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"bool":{"must":[{"range":{"created_time":{"gte":"2015-03-20T00:00:00.000Z","lte":"2015-04-20T00:00:00.000Z"}}}],"should":[{"match":{"brand_id":"TarunTahiliani"}}],"minimum_should_match":1}},"aggs":{"posts_over_days":{"terms":{"script":"Date date = new Date(doc['created_time'].date.getMillis() + 19800000) ;java.text.SimpleDateFormat format = new java.text.SimpleDateFormat('u');format.format(date)","order":{"_term":"asc"}}},"posts_over_hours":{"terms":{"script":"Date date = new Date(doc['created_time'].date.getMillis() + 19800000) ;java.text.SimpleDateFormat format = new java.text.SimpleDateFormat('HH');format.format(date)","order":{"_term":"asc"},"size":24}},"users_most_replied":{"terms":{"script":"return if(doc['reply'].empty) {} else {doc['in_reply_to_screen_name.raw'].value}","size":4}},"users_most_retweeted":{"terms":{"script":"return if(doc['retweet'].empty) {} else {doc['retweeted_user_screen_name.raw'].value+'|'+doc['retweeted_user_name.raw'].value+'|'+doc['retweeted_user_image.raw'].value}","size":4}},"users_most_mentioned":{"terms":{"field":"mention_entries.raw","size":4}}}}]]]; nested:
 GroovyScriptCompilationException[MultipleCompilationErrorsException[startup failed:
at respond (/home/harshil/working_dir/prophesee/dashboard-backend/PropheseeDashboard/node_modules/elasticsearch/src/lib/transport.js:233:15)
at checkRespForFailure (/home/harshil/working_dir/prophesee/dashboard-backend/PropheseeDashboard/node_modules/elasticsearch/src/lib/transport.js:201:7)
at HttpConnector.<anonymous> (/home/harshil/working_dir/prophesee/dashboard-backend/PropheseeDashboard/node_modules/elasticsearch/src/lib/connectors/http.js:147:7)
at IncomingMessage.bound (/home/harshil/working_dir/prophesee/dashboard-backend/PropheseeDashboard/node_modules/elasticsearch/node_modules/lodash-node/modern/internals/baseBind.js:56:17)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickDomainCallback (node.js:459:13)

at Function.Promise$Defer (/home/harshil/working_dir/prophesee/dashboard-backend/PropheseeDashboard/node_modules/elasticsearch/node_modules/bluebird/js/main/promise.js:296:13)
at Transport.defer (/home/harshil/working_dir/prophesee/dashboard-backend/PropheseeDashboard/node_modules/elasticsearch/src/lib/transport.js:102:18)
at Transport.request (/home/harshil/working_dir/prophesee/dashboard-backend/PropheseeDashboard/node_modules/elasticsearch/src/lib/transport.js:291:18)
at exec (/home/harshil/working_dir/prophesee/dashboard-backend/PropheseeDashboard/node_modules/elasticsearch/src/lib/client_action.js:284:20)
at Object.action (/home/harshil/working_dir/prophesee/dashboard-backend/PropheseeDashboard/node_modules/elasticsearch/src/lib/client_action.js:28:14)
at Object.module.exports.getTwitterTweetsAnalytics (/home/harshil/working_dir/prophesee/dashboard-backend/PropheseeDashboard/api/controllers/AnalyticsController.js:2159:10)
at bound (/home/harshil/working_dir/prophesee/dashboard-backend/PropheseeDashboard/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21)
at routeTargetFnWrapper (/home/harshil/working_dir/prophesee/dashboard-backend/PropheseeDashboard/node_modules/sails/lib/router/bind.js:179:5)

我目前使用的ES版本是1.5.1。有人能指出我如何解决这个问题的正确方向吗?

2 个答案:

答案 0 :(得分:0)

可以参考我的笔记,关于groovy异常,最有可能的是它需要更严格:

https://note.youdao.com/share/?id=b7aa6a0f76f460d8c91512d4fd164a7d&type=note#/

答案 1 :(得分:0)

线程“main”中的异常org.codehaus.groovy.control.MultipleCompilationErrorsException:启动失败: script15223772316671720760001.groovy:1:意外令牌:stopWatch @第1行,第1070列。

这个问题是由groovy本身引起的,解决方案是你的代码可以添加“;”在后面的“}”;例如:

enter image description here