I'm trying to write a SearchPlugin to do custom scoring, but I can't figure out how to access the doc values in my leaf score function.
The LeafScoreFunction.score() method takes a docId parameter. Is there a way to use that to get to the doc values.
Also, where is the proper place to get access to the document? In the LeafScoreFunction methods? Should I get access to it in the ScoreFunction.getLeafScoreFunction() method and pass it in to my LeafScoreFunction? Somewhere else?
It looks like you are attempting to implement a FunctionScoreQuery. This class doesn't itself know anything about Lucene, only some implementations do (like ScriptScoreFunction). Maybe consider using an advanced script instead. The docs for writing native scripts (through a custom script engine) explain how to access Lucene data structures.
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.