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

Multiple boost of each matching value in one field

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

"itm_field_skills":[1, 2]

现在我有以下查询:

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

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

绝对分数值不是你可以依赖的。您的查询并不意味着您的分数将是 5 或 10 - 只是这些术语比您查询的其他部分重要 five/ten 倍。

如果您查看 debugQuery 的输出,您会看到提升 (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