R
R
ruboss2015-10-10 22:31:27
Java
ruboss, 2015-10-10 22:31:27

Elasticsearch java client - random or works every other time?

Hey!
What needs to be done to make the ElasticSearch java client work always and not once out of five?
Specifically, they kill exceptions that crash 4 times out of 5 launches of the program.
I create client and node

node = nodeBuilder().node();
  client = node.client();

Next comes the code, with requests to elasticsearch and it works out of 4 times. There are no errors in the code. The problem, as far as I understand, is in the client. Throws exceptions related to the execution of a groovy script.
additional settings in ES client config
script.groovy.sandbox.enabled: false
script.inline: on
script.indexed: on

java.util.concurrent.ExecutionException: org.elasticsearch.ElasticsearchIllegalArgumentException: failed to execute script
  at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.getValue(BaseFuture.java:292)
  at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:279)
  at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:117)
  at statistic.Elastic.upsert(Elastic.java:80)
  at statistic.VideoIndex.getHashesIndex(VideoIndex.java:451)
  at statistic.VideoIndex.index(VideoIndex.java:137)
  at statistic.Main.main(Main.java:57)
Caused by: org.elasticsearch.ElasticsearchIllegalArgumentException: failed to execute script
  at org.elasticsearch.action.update.UpdateHelper.prepare(UpdateHelper.java:202)
  at org.elasticsearch.action.update.TransportUpdateAction.shardOperation(TransportUpdateAction.java:176)
  at org.elasticsearch.action.update.TransportUpdateAction.shardOperation(TransportUpdateAction.java:170)
  at org.elasticsearch.action.support.single.instance.TransportInstanceSingleOperationAction$AsyncSingleAction$1.run(TransportInstanceSingleOperationAction.java:187)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source)
Caused by: org.elasticsearch.ElasticsearchIllegalArgumentException: script_lang not supported [groovy]
  at org.elasticsearch.script.ScriptService.getScriptEngineServiceForLang(ScriptService.java:231)
  at org.elasticsearch.script.ScriptService.compile(ScriptService.java:270)
  at org.elasticsearch.script.ScriptService.executable(ScriptService.java:457)
  at org.elasticsearch.action.update.UpdateHelper.prepare(UpdateHelper.java:196)
  ... 6 more

How to achieve the work of the script 1 of 1? What is my mistake?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question