【发布时间】:2020-09-05 21:27:30
【问题描述】:
有什么方法可以从弹性相关性评分中删除默认的提升词或将其设为 1(因此它不会反映在评分中)。例如,
编辑:输入查询是
GET test_index/_search
{
"query": {
"match": {
"text": "asia pacific"
}
},"explain": true
}
部分结果是
"details" : [
{
"value" : 6.5127892,
"description" : "weight(text:asia in 5417) [PerFieldSimilarity], result of:",
"details" : [
{
"value" : 6.5127892,
"description" : "score(freq=6.0), product of:",
"details" : [
{
"value" : 2.2,
"description" : "boost",
"details" : [ ]
},
{
"value" : 3.8113363,
"description" : "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
"details" : [
{
"value" : 462,
"description" : "n, number of documents containing term",
"details" : [ ]
},
{
"value" : 20909,
"description" : "N, total number of documents with field",
"details" : [ ]
}
]
},
{
"value" : 0.7767246,
"description" : "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
"details" : [
{
"value" : 6.0,
"description" : "freq, occurrences of term within document",
"details" : [ ]
},
{
"value" : 1.2,
"description" : "k1, term saturation parameter",
"details" : [ ]
},
{
"value" : 0.75,
"description" : "b, length normalization parameter",
"details" : [ ]
},
{
"value" : 1048.0,
"description" : "dl, length of field (approximate)",
"details" : [ ]
},
{
"value" : 662.01294,
"description" : "avgdl, average length of field",
"details" : [ ]
}
]
}
]
}
]
},
这是对简单匹配查询中的一个术语的解释。 在上面的示例中,我想删除 2.2 的提升项或使其等于 1。 请建议如何执行此操作。
【问题讨论】:
标签: elasticsearch boost relevance