I've created a similarity plugin but I am unable to use the same in ES 5.3.
I am able to use the same plugin in 1.7.6 version and it's working too.
But I'm fearing that if I stick to old version, I'll loose all the new features and fixes available till now.
Could anybody suggest what's the method to use similarity plugin in latest versions 5.x?
I've seen a similar post (below), but looks like it just closed today!
I want to use my plugin in the new version. Please help me to solve this issue or provide any ES docs if any.
That would be a great help.
In ES 5.x, the way to do this is by overriding the onIndexModule method of Plugin. You would then call something like this:
indexModule.addSimilarity("my_sim_name", (name, providerSettings, indexSettings) ->
new SimilarityProvider() {
@Override
public String name() {
return name;
}
@Override
public Similarity get() {
return /* CONSTRUCT YOUR SIMILARITY*/;
}
});
Note that this will most likely change again at some point in the future, as we have been moving to pull based plugins, while this is still a push based api (ie addFoo).
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.