I have a stored script which does some calculation and returns a number. I'm using it to populate a scripted field. And I need to use the pretty much same script for filtering out the results. Firstly, I try to access the scripted field in order to use it for filtering but apparently, we cannot access the scripted field from other scripts.
So, I wonder if it is possible to call the stored script from another script or not?
// something like this
"source": "_scripts.foo_stored_script(params) > THRESHOLD"
Is it possible to do this? Or is there an easier way to do something like this?