在一个字段中多次提升每个匹配值

时间:2018-06-11 12:50:59

标签: solr solr-boost

我有一个多字段,其中包含以下值:

"itm_field_skills":[1, 2]

现在我有以下查询:

q=itm_field_skills:(1+OR+2)^5

所以我得到了结果,但得分是5。 我想通过提升每个匹配值来提出搜索请求,以获得10分。

1 个答案:

答案 0 :(得分:0)

绝对得分值不是您可以信赖的。您的查询并不意味着您的分数将为5或10 - 只是这些条款比查询的其他部分重要五到十倍。

如果你查看debugQuery的输出,你会看到boost(5)被单独应用到每个术语,然后这些术语的分数在之后被加在一起。

4.8168015 = sum of:
  1.2343608 = weight(..) [SchemaSimilarity], result of:
    1.2343608 = score(doc=0,freq=1.0 = termFreq=1.0
), product of:
      5.0 = boost <----
      0.3254224 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:
        6.0 = docFreq
        8.0 = docCount
      0.7586207 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:
        1.0 = termFreq=1.0
        1.2 = parameter k1
        0.75 = parameter b
        1.125 = avgFieldLength
        2.0 = fieldLength
  3.5824406 = weight(..) [SchemaSimilarity], result of:
    3.5824406 = score(doc=0,freq=1.0 = termFreq=1.0
), product of:
      5.0 = boost <---
      0.9444616 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:
        3.0 = docFreq
        8.0 = docCount
      0.7586207 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:
        1.0 = termFreq=1.0
        1.2 = parameter k1
        0.75 = parameter b
        1.125 = avgFieldLength
        2.0 = fieldLength