Elasticsearch plugin develop

I want to develop es plugin like the official website example :https://github.com/elastic/elasticsearch/blob/master/plugins/examples/script-expert-scoring/src/main/java/org/elasticsearch/example/expertscript/ExpertScriptPlugin.java
But I have multiple pairs of field and term,how do I deal with the function “ setDocument ”?

Thank you for your reply!

For multiple terms/fields, you'll need to load a PostingsEnum for each term. See line 109 in the example you linked. You then need to call setDocument on all of your postings inside ScriptScore.setDocument on line 126. This will ensure your postings enums are ready to read inside ScriptScore.execute.

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