Similarity plugin usage in the latest version of ES 5.3

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.

Thank you.

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).

Thanks Ryan for your response.
We are checking this and respond to you about our results.

Thanks Ryan.
It solved our confusion, and its working. :joy:

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