I'm trying to write a ScriptedEngine because I want to directly access some Lucene-level info (term frequency, position of term in the matched document, etc). In the ScriptedEngine, I want to analyze the query term using the same analyzer configured for the field that's being searched.
We have other plugins on our cluster deployment, specifically a SearchPlugin
, where the task of analyzing a query term in this way is straightforward because when extending the AbstractQueryBuilder
interface, you have to override the doToQuery
method which accepts a QueryShardContext
as a parameter, and you can use that parameter to figure out the analyzer.
Could someone guide me towards a way to do this in the context of the ScriptedEngine?
Thank you!
P.S., we are on Elasticsearch version 6.5.1.