Looking for pointers to know how Groovy script can be invoked using java api.
test.groovy
def value = dynamicValue
return value
Want to translate following query in Java:
GET /test-index/_search
{
"query": {
"match_all": {}
},
"script_fields": {
"checkValue": {
"script": "test",
"params": {
"dynamicValue": 7
}
}
}
}
v1.4.3and you haven't changedscript.groovy.sandbox.enabled: falsetoscript.groovy.sandbox.enabled: true, then ignore me! Otherwise, you need to check whether you can access your cluster byyour_external_ip_address:9200(you shouldn't get a response). Try to connect as aNodeto your cluster from a far-away computer, you must not be able to access, try likeClient CLIENT = new TransportClient(ImmutableSettings.settingsBuilder().put("cluster.name", "your_name").build()).addTransportAddress(new InetSocketTransportAddress("external_ip", 9300));.elastic.colink:If you are running a vulnerable version of Elasticsearch, you should either upgrade to at least v1.3.8 or v1.4.3, or disable dynamic Groovy scripts by adding this setting to the config/elasticsearch.yml file in all nodes in the cluster:script.groovy.sandbox.enabled: falseas you said. So according toES, you're fine...