I've got a search system where I allow users to set their preferences, then I boost results in a SOLR search according to these preferences. I'd like to give the users some visual feedback when a result has been boosted, but to do this I need to find a way to tell if a particular result has been boosted.
So far, I've thought of using the score value and if the score is above a certain threshold then I know it's been boosted, however the score seems to change quite a bit from query to query so I don't know how to set such a threshold.
If I had access to the pre-boost score somehow in the result, then I could compare this with the final post-boost score and know that the result had been boosted but I don't think the pre-boost score is available (please correct me if I'm wrong).
Does anyone have any other ideas how to achieve this?
you add this to your request:
&debugQuery=true
then you will get a debug
element in your response. Among other things, in contains explain
where you can see (for each doc id returned) how it's score is built. If you parse that info, you can see if it comes from, including boosting info).
explain
info is quite convoluted to parse, there is even a page to help you with that.
来源:https://stackoverflow.com/questions/30071089/is-there-a-way-to-tell-if-a-result-has-been-boosted-in-solr