hi
I have looked into the few examples, of painless script
https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-execute-api.html
A current example shown is
POST /_scripts/painless/_execute
{
"script": {
"source": "params.count / params.total",
"params": {
"count": 100.0,
"total": 1000.0
}
}
}
But all the examples show "inline" script of 1 or 2 lines, but we got a complex logic and wanted to externalise the painless script, so that I can pass parameters into the script and get return value (a typical function call concept)
the one I'm looking forward is something like
POST /_scripts/painless/_execute
{
"script": {
"name": "my_external_script(count,total)",
"params": {
"count": 100.0,
"total": 1000.0
}
}
}