0

如何提升记录取决于 Solr 中的任何字段。

参考链接:https ://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_increase_the_score_for_specific_documents

但我的情况并不清楚。

搜索后我有一些记录

在此处输入图像描述

如何获得 ID:5、8、17 和 1 提升了一些步骤而不是列表的顶部,只是提升了一些步骤。因为它的价格更高。

这是我的行查询;

select?mm=100%25&version=2.2&q=(book)&defType=edismax&spellcheck.q=(book)&qf=Price^10+Name^1+nGramContent&spellcheck=true&stats=true&facet.mincount=1&facet=true&spellcheck.collate=true&stats.field=Price&rows=50&indent=on&wt=json&fl=Id,score,Price

请帮我。

谢谢!

4

1 回答 1

0

这些qf参数用于字段中的匹配,除非查询在字段中产生匹配,否则不会影响排名。您的示例将要求您搜索 price (而不是)以查找要由参数book提升的任何内容。qf=Price^10

您链接到的常见问题解答回答了您的问题,而不是您引用的问题:如何根据字段的值更改文档的分数。从示例中(将流行度替换为您的案例的价格):

# simple boosts by popularity
defType=dismax&qf=text&q=supervillians&bf=popularity
q={!boost b=popularity}text:supervillians

# boosts based on complex functions of the popularity field
defType=dismax&qf=text&q=supervillians&bf=sqrt(popularity)
q={!boost b=sqrt(popularity)}text:supervillians

edismax 使 {!boost} (乘法提升)也可用作boost=参数,因此您可以直接引用它而不是在查询中使用它。

于 2016-07-14T10:35:22.200 回答