I have a plugin with some native scripts. Successfully install to ES 2.0:
module.registerScript("test-script", TestScript.Factory.class);
Is there any way to get this script inside another groovy script. Previously I used facets to get that script from script context. But ES 2.0 stop supporting facets.
Example: I want to get "test-script" inside "init_script" of aggregation
POST indext/_search
{
"query": {"match_all": {}},
"aggregations" : {
"test" : {
"scripted_metric" : {
"init_script" : "* script = new TestScript() OR scriptService = _ctx.scriptService(); script = scriptService.compile('native','test-script', null); //worked with facet; script.run(params);",
"map_script" : "test-script"
}
}
}
}