Developer forum

Forum » Feature requests » CustomScoreProvider

CustomScoreProvider

Aki Ruuskanen
Aki Ruuskanen
Reply

It would be really nice to be able to implement a "CustomScoreProvider" for Lucene. 

Regards / Aki


Replies

 
Nicolai Pedersen
Reply

Lucene supports this using a custom Similarity implementation.

But are you sure that is what you want? Can you explain your use case - usually it can be done using a custom field on the index and sorting by that field. Using Similarity implementation is only required if you need to change scoring based on the input parameter values in the query.

BR Nicolai

 
Aki Ruuskanen
Aki Ruuskanen
Reply

My first approach was sorting by a custom field. But (as you say) I need different scoring depending on a parameter.

What I'm trying to accomplish is a custom sorting depending on users "actions" after a freetextsearch based on a particular phrase. (I don't know if that sentence makes sense smiley )

If, for example, some users have searched for "coffe" and cliked on products "PROD1" and "PROD5" I want those products to have a higher score in future searches of "coffe" for all users. The whole idea is a bit more complex than that with a number of other parameters but it's the basic idea. Kind of a self learing search engine. A cybernetic organism. smiley

I have come up with an other approach to (kind of) solve it but ideal would be to be able to poke around with the scoring. 

Regards / Aki

 

 
Nicolai Pedersen
Reply

Ok, understood. But what you basically want here is a sort by number of clicks - so whenever someone clicks a product based on a search term, you can add a column to the index for each search term and store the number of clicks - will give a number of columns, but it would work.

However - I am not sure this feature is a good idea. The first person searches for coffee, clicks 2 products, now they bubble on top for the next search - and people will click them because they are on top and in the end, it will be more and more biased result leading to a bad search result...

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Yes, using several fields is the second appoach but in a slightly different way. 

I see what you mean with the biased result. The feature also included a number of other parameters other than just clicks. 

What we are trying to achive is to boost products in certain product groups. 

With the "coffe" example you would get results including coffe makers, coffe milk, coffes poons, coffe mugs, coffe filters. etc, etc. In that case we want to boost products in the group with the actual coffe.

 

Regards / Aki