Shailendra
Shailendra

Reputation: 567

Enable scripting in elasticsearch-2.2.0 using Java API

I am using elasticsearch-2.2.0 version. I need to enable scripting using JAVA API. Basically I want to create a node using NodeBuilder and enable scripting support.

I tried setting the properties "script.inline : true" and "script.indexed : true" as below :

Settings settings = Settings.builder().put("script.inline", true).put("script.indexed", true).build();

but still it does not works.

Is there a way to enable scripting in elasticsearch-2.2.0 version using JAVA ?

Upvotes: 0

Views: 191

Answers (1)

Val
Val

Reputation: 217554

This is similar to this issue and it seems that when creating a local NodeClient the lang-groovy module is not loaded by default.

So you need to add another dependency in your pom.xml

<dependency>
   <groupId>org.elasticsearch.module</groupId>    
   <artifactId>lang-groovy</artifactId>
   <version>2.2.0</version>
</dependency>

Upvotes: 1

Related Questions