Using params in a scripted similarity

I would like to create a scripted similarity in which I can pass parameters at query time.

For example, I would like to pass the number of words in my query into the script so that the value can be used in my scripted score calculation. The documentation claims this is possible via the "params" variable, but when I try to access "params" I get a compilation error "Variable [params] is not defined." Please help.

https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-similarity-context.html#painless-similarity-context

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.