Custom similarity in Elasticsearch 5.0

(Peter van der Weerd) #1


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 van der Weerd) #2

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


(edwin) #3

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

(Peter van der Weerd) #4

Hi Edwin,

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

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

(edwin) #5

it worked!
thanks a lot

(system) #6

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