Hi, Thank you for your work!
I am trying to use Indexed Scripts API from java.
This is the tutorial that I tested.
my client does not have those methods and Response classes.
I am using elastic cloud(v5.5.1).
What is the correct way to use 'Indexed Scripts API'.
code
PutIndexedScriptResponse = client.preparePutIndexedScript()
.setScriptLang("painless")
.setId("script1")
.setSource("script", "_score * doc['my_numeric_field'].value")
.execute()
.actionGet();
GetIndexedScriptResponse = client.prepareGetIndexedScript()
.setScriptLang("painless")
.setId("script1")
.execute()
.actionGet();
DeleteIndexedScriptResponse = client.prepareDeleteIndexedScript()
.setScriptLang("painless")
.setId("script1")
.execute()
.actionGet();
POM
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>5.5.1</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>rest</artifactId>
<version>5.5.1</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>x-pack-transport</artifactId>
<version>5.5.0</version>
</dependency>
client
TransportClient javaClient = new PreBuiltXPackTransportClient(settings)
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(fullhost), 9343));
client works fine for other functions.
error
1. PutIndexedScriptResponse cannot be resolved to a variable
2. The method preparePutIndexedScript() is undefined for the type TransportClient
Thanks.
HJ.