有没有办法判断结果是否在 SOLR 中得到了提升? [英] is there a way to tell if a result has been boosted in SOLR?

查看:50
本文介绍了有没有办法判断结果是否在 SOLR 中得到了提升?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个搜索系统,允许用户设置他们的偏好,然后我根据这些偏好在 SOLR 搜索中提升结果.当结果得到提升时,我想给用户一些视觉反馈,但要做到这一点,我需要找到一种方法来告诉特定结果是否得到提升.

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

然后你会在你的响应中得到一个 debug 元素.除此之外,在包含 explain 的地方你可以看到(对于返回的每个文档 id)它的分数是如何构建的.如果您解析该信息,您可以查看它是否来自,包括提升信息).

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 信息解析起来相当复杂,甚至还有一个页面帮您解决这个问题.

explain info is quite convoluted to parse, there is even a page to help you with that.

这篇关于有没有办法判断结果是否在 SOLR 中得到了提升?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆