I'm new to elasticsearch, actually i started testing its functionalities and potentials just few day ago. You we built a really cool piece of code here btw!
Something i found really interesting are results scores and the result sorting based upon them. But far more interesting are scripts built to evaluate scores upon specific needs. I found this description: https://www.elastic.co/guide/en/elasticsearch/guide/current/script-score.html
That was far enought to understand how to use them, the only concern I got about was the following: below the 4th code example they state as follow:
"By passing in these variables as params, we can change their values every time we run this query without having to recompile the script."
And i can not understand if "recompile the script" refers to rewriting the JSON (therefore to be lazy) or that Elasticsearch engine is actually absorbing the script from previous queries and therefore just changing parameters do not require the system to reparse the script and therefore improve the performances.
So, am I affecting the performances if upon each querry i'm passing a slightly different script with hardcoded variables inside and maybe some different doc.value?