Solr dismax查询
我正在尝试创建一个功能,允许通过此公式sum(weight1 *文本相关性得分,weight2 *价格)显示搜索结果。 weight1
和 weight2
是可以更改以影响搜索结果的数值。
我将以下查询参数发送到 Solr 实例进行搜索。
q=red
defType=dismax
qf=10^name+2^price
我的理解是,当使用 dismax 时,Solr/Lucene 会在 qf
参数中指定的所有字段中查找搜索文本。
目前,我的搜索结果与 qf
不包含价格时得到的结果类似。我认为这是因为价格是数字字段并且没有文本匹配。
是否可以根据此公式对搜索结果进行排名 - sum(weight1*text 相关性得分,weight2 * 价格)
。
I am trying to create a feature that allows search results to be displayed by this formula sum(weight1*text relevance score, weight2 * price)
. weight1
and weight2
are numeric values that can be changed to influence the search results.
I am sending the following query params to the Solr instance for searching.
q=red
defType=dismax
qf=10^name+2^price
My understanding is that when using dismax, Solr/Lucene looks for the search text in all the fields specified in the qf
param.
Currently my search results are similar to those I get when qf
does not including a price. I think this is because price is a numeric field and there is not text match.
Is it possible to rank search results based on this formula - sum(weight1*text relevance score, weight2 * price)
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你就快到了! qf 的语法是
qf=field^weight
,而不是相反。有关更多详细信息,请参阅本文档。
You were almost there! The syntax of qf is
qf=field^weight
and not the other way around.See this document for more details.