Currently custom similarity implementations are added on a per index basis. In your plugin extend the Plugin class, and override the onIndexModule method. Then call IndexModule.addSimilarity.
I see that I have to set a Trifunction with parameters settings, version and scriptService. While settings seems to be accesible in plugin (actually not the same but a List of Setting ), not sure how access or generate version and scriptService.
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.