Solr:如何避免分数被多个值稀释?

Solr: How to avoid the score to be diluted by multiple values?

我的 collection 包含具有多值 tags 字段的产品。

  1. 一个产品 (P1) 可能有标签:“鞋子”。
  2. 另一个 (P2) 可能有标签:“鞋子”、“运动”、“网球”。

考虑到受欢迎程度,这些产品将通过功能得到提升。但是,仅查找“鞋子”的基本分数将为:P1 为 1.5774288,P2 为 1.3096721。

两种产品的分数可能相同吗?

就好像许多标签的存在“稀释”了相关性,因为产品具有比“鞋子”更多的标签。这会干扰增强功能。

您可以使用 filter query fq=Shoes 而不是查询参数 q= 来过滤匹配文档而不影响分数。对结果进行评分的第二个查询参数仍然有用,因为您可以将两者结合起来。

The fq parameter defines a query that can be used to restrict the superset of documents that can be returned, without influencing score.

根据 MatsLindh in a 的建议,在字段上设置 omitNorms="true" 并重新索引集合使得获得相同的分数成为可能。