0

我有一个多个字段,具有以下值:

"itm_field_skills":[1, 2]

现在我有以下查询:

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

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

4

1 回答 1

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
于 2018-06-11T13:46:56.840 回答