Scoring Script performance

(Borut Svara) #1

Hy everyone,

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:
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?

Thankyou, Svara

(Mark Walkom) #2

It's the latter.

(system) #3