Sphinx:了解大型领域的邻近因素排名

Sphinx: Understanding Proximity Factor Ranking for a large field

This 文档解释了 sphinx 邻近因子排名算法(参见部分:短语邻近因子)。

如果在字段中多次找到关键字,邻近系数排名器是否会给出更高的字段权重?

例如。使用与链接文档的参考部分类似的逻辑。对于单个实例匹配短语权重为 2:

1) query = one two three, field = one and two three
field_phrase_weight = 2 (because 2-keyword long "two three" subphrase matched)

如果同一个短语被匹配了两次怎么办?体重会翻倍吗?:

2) query = one two three, field = one and two three one and two three
field_phrase_weight = 4? (because 2-keyword long "two three" subphrase matched twice?)

我怀疑上述问题的答案是否定的——无论keyword/keyword子序列被多次找到,sphinx都会return相同的字段权重。如果是这种情况,如果像一篇文章这样的大型 sphinx 字段将 return 相同的字段权重而不管内容大小,如何利用邻近算法? 特别是考虑到用于搜索的首选 sphinx 算法是 proximity_bm25 排名器,它非常依赖 "proximity ranking"(对于多字段文档,至少 60% 的算法将加权到 bm25 上的邻近度排名?

Will the proximity factor ranker give a higher field weight if the keyword is found more than once in the field?

没有。将应用相同的字段权重。

eg. using similar logic to the referenced section of the linked document. For a single instance match phrase weight would be 2:

1) query = one two three, field = one and two three field_phrase_weight = 2 (because 2-keyword long "two three" subphrase matched)

What about if the same phrase was matched twice? Would the weight be double?:

2) query = one two three, field = one and two three one and two three field_phrase_weight = 4? (because 2-keyword long "two three" subphrase matched twice?)

在这个例子中,权重不会在第二个查询中加倍。

how to make good use of the proximity algorithm for large sphinx fields like an essay if this will return the same field weight regardless of content size?

我能想到的唯一方法是通过接近度的组合为多个关键字短语赋予更高的权重,同时在算法中赋予 BM25 足够的权重以增加提供 "rare keywords occurring more often in documents" 的价值因素。 Proximity_BM25排名算法的BM25部分就是为此目的而设计的。

这是 proximity_bm25 表达式:sum(lcs*user_weight)*1000+bm25,该算法的 bm25 组件逐渐变得越来越无关紧要,文档中的 sum(lcs*user_weight)*1000 部分的 sphinx 字段越多公式适用于每个单独的字段,而等式的 bm25 部分适用于整个文档。

在我有 10 个 sphinx 字段的情况下,bm25 仅占总重量的 5% - 我提高了公式的 bm25 部分的重量以占大约总重量的 20% 改变公式:

sum(lcs*user_weight)*1000+bm25*4