Question

I would like SolR to be able to "learn" from my website users' choices. By that i mean that i know which product the user click after he performed a search. So i collected a list of [term searched => number of clicks] for each product indexed in SolR. But i can't figure how to have a boost that depends on the user input. Is it possible to index some key/value pairs for a document and retrieve the value with a function usable in the boost parameter ?

I'm not sure to be clear, so i'll add a concrete example :

Let's say that when a user search for "garden chair", SolR returns me 3 products, "green garden chair", "blue chair", and "hamac for garden". "green garden chair" ranks first, the hamac ranks last, as expected. But, then, all the users searching for "garden chair" ends up clicking on the hamac.

I would like to help the hamac to rank first on the search "garden chair", WITHOUT altering the rank it got on other search. So i would like to be able to perform a key=>value based boost. Is that possible to achieve with SolR ?

I'm sure that i can't be the first one needing such user-based search results improvement.

Thanks in advance.

Was it helpful?

Solution

You could you edismax bq, if you are using edismax (or maybe bf). For this to work, you obviously need to store the info (in a db, redis, whatever you fancy):

  • searched "garden chair":
    • clicked "hamac for garden": 10
    • clicked "green garden chair": 4
  • searched "green table":
    • ...

And so forth, look this up when there is a search, and if there is info available for the search, send the bq boosting what you want.

Also, check out the QueryElevationComponent It might your purpose (although is stronger than just boosting....). There are two things to consider though:

  1. Every time you change the click number you would need to modify the xml and reload, so it would be better if you could batch it to nightly or something like that.
  2. there was a recent jira issue to allow you to provide similar functionality but by providing request params, no need of xml/reload, so check that out too
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top