0

我有一个看起来像这样的查询:

qt=/solrSearchHandler&q={!func}sum(0,0)&bf=someFloatField^1

文件someFloatField的价值为 1。

我正在使用带有 edismax defType 的 solr.SearchHandler 请求处理程序。

我试图弄清楚为什么文档的分数不是 bf/boost 和函数查询值(指定为 q)的总和。

在这个例子中,我希望分数是 1 (sum(0,0) + boost weight=1 * someFloatField=1),但实际上是 0。在玩完这些数字后,我看到分数实际上被计算为:

q + bf * q

代替

q + bf 

这是我对添加剂增强的期望。也许我对如何将提升纳入分数感到困惑。如果是这样,我将不胜感激有关如何简单地添加 2 个值的任何指示。

4

1 回答 1

0

According to the wiki, the bf parameter is additive. If you need multiplicative, use the boost parameter instead.

http://wiki.apache.org/solr/ExtendedDisMax#bf_.28Boost_Function.2C_additive.29

The bf parameter stands for "boost function" but the value you've indicated looks like you're treating it as "boost field" instead. If you need to use the value of that field to calculate your boost, you can do so in a function query, which is what the bf is expecting:

http://wiki.apache.org/solr/FunctionQuery

If I am reading that right, the 'def' function might be what you need, possibly in a more complex overall function. I could be misunderstanding all this, though.

于 2013-08-08T20:35:00.457 回答