如何根据条件提高 Solr 搜索结果的分数?
背景:
1 - 我使用 WebSolr 进行此搜索。 2 - 我有两个字段存储在 websolr 中 - 名称和 ID。
我想根据名称搜索这些条目并根据此标准提高搜索分数:
if id in [x1,x2..xN] then +2
if id in [y1,y2..yN] then +1
else +0
根据我的研究,答案如下 - 函数查询,或 - DisMaxQParser
我已经查看了文档,但在我看来它不是很全面。
任何帮助表示赞赏。
Background:
1 - I'm using WebSolr for this search.
2 - I have two fields stored in websolr - name and id.
I want to search for these entries based on name AND boost the search score based on this criteria:
if id in [x1,x2..xN] then +2
if id in [y1,y2..yN] then +1
else +0
From my research, the answer lies in the following
- Function query, or
- DisMaxQParser
I have looked at the documentation but IMO its not very comprehensive.
Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

您可以使用增强功能。尝试像这样的查询
You can use boosts. Try a query like