@javanna: Thanks so much for your help.
My scenario:
Previously with ES 1.5, i have native script to calculate total amount (logic is very complex). then I have multiple scripts run with facet plugin using map-reduce approach. Inside those scripts, get total script to calculate amount, then use it for some logic:
compiledScript = scriptService.compile('native','amount', null);
executableScript = scriptService.executable(compiledScript, param);
amount = executableScript.run(doc())
Now I want to upgrade to ES 2.0 without facet support, so I try to use aggregation. But due to security problem, now no way to access native to do that.
I tried to switch solution, build other native which used to call groovy map-reduce scripts but still stuck: https://github.com/elastic/elasticsearch/issues/17461
Even with native, I cannot access ScriptService, only GroovyScriptEngineService and couldn't invoke File Scripts.
Did I do anything wrong or we cannot do it ?
Please advice.
Thanks.