I have been spelunking through Elastic code to try to understand how the following is possible. The Analysis Predicate Context says that painless scripts run at analysis can accept query-time params"
params ( Map , read-only)
User-defined parameters passed in as part of the query.
However, I'm unable to figure out if this is actually true or not. Because the "script" body appears as a mapping definition, I would not expect to be able to pass "params" anywhere (there's no specific place in a query to pass in query time params for analysis scripts?)
Indeed in the associated PR, I do not see any reference to "Query Time Params"
I was hoping that this note in the docs pointed at a way to change analyzer settings per-query (aside from changing the analyzer itself. But I don't see any such code, and given my knowledge of Lucene, etc, I wouldn't expect to find an ability to change analyzer internal params per query.
Is this correct? I just want to confirm my understanding that the docs may actually be incorrect here?
Happy to send in a PR of course, just want to confirm
But I think params are really defined in the context the script is used, and in the case of analyzers, you can't really pass params along with the query that uses the analyzer itself...
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.