Custom similarity in Elasticsearch 5.0

Hi,

I'm porting my custom similarity provider to 5.0. There seems to be no interface that I can implement on my plugin to return a similarity provider.

Before diving too deep: is this functionality removed in 5.0 (no, right????)?
Or should it be implemented different nowadays?

Kind regards,
Peter

Nevermind. The IndexModule has an addSimilarity(). Will try that.

/P

Hi,Did you figure out how to solve the problem?

Hi Edwin,

Yep, just override the onIndexModule () in your plugin, like:

@Override
public void onIndexModule(IndexModule indexModule) {
    indexModule.addSimilarity("bounded_similarity", (name,settings)->new BoundedSimilarity.Provider(name, settings));	
}
1 Like

it worked!
thanks a lot

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