I am migrating from an old version of elasticsearch (1.4.4). I had a groovy script, that was importing classes from the java classpath. With my earlier script I was executing updates, conditionally.
With the new version (6.2.3), groovy is no longer supported and I have no idea how I can achieve the same functionality with painless.
I do not know whether I need to implement a ScriptEngine, and if yes, where can I find some examples for a ScriptEngine that will do updates? I have searched on google and also these forums, but have found nothing beyond the boilerplate code for a SearchScript Engine.
Here is some example code from my earlier script:
import mypackage.class.name import mypackage.otherclass.name OtherClass ex = new OtherClass(); ctx._source.text = "something"; ctx._source.ex1 = ex;
If anyone can guide me on how to implement updates using a ScriptEngine , I would be really obliged. Or alternatively, how do I import my custom java classes into a Painless Script?