欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

6搜索接口--12解释接口

程序员文章站 2022-03-16 18:56:07
...
对搜索进行解释分数计算过程。如:
GET /twitter/tweet/0/_explain
{
"query" : {
"match" : { "message" : "elasticsearch" }
}
}
返回
{
"_index": "twitter",
"_type": "tweet",
"_id": "0",
"matched": true,
"explanation": {
"value": 1.55077,
"description": "sum of:",
"details": [
{
"value": 1.55077,
"description": "weight(message:elasticsearch in 0) [PerFieldSimilarity], result of:",
"details": [
{
"value": 1.55077,
"description": "score(doc=0,freq=1.0 = termFreq=1.0\n), product of:",
"details": [
{
"value": 1.3862944,
"description": "idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:",
"details": [
{
"value": 1.0,
"description": "docFreq",
"details": []
},
{
"value": 5.0,
"description": "docCount",
"details": []
}
]
},
{
"value": 1.1186441,
"description": "tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:",
"details": [
{
"value": 1.0,
"description": "termFreq=1.0",
"details": []
},
{
"value": 1.2,
"description": "parameter k1",
"details": []
},
{
"value": 0.75,
"description": "parameter b",
"details": []
},
{
"value": 5.4,
"description": "avgFieldLength",
"details": []
},
{
"value": 4.0,
"description": "fieldLength",
"details": []
}
]
}
]
}
]
},
{
"value": 0.0,
"description": "match on required clause, product of:",
"details": [
{
"value": 0.0,
"description": "# clause",
"details": []
},
{
"value": 1.0,
"description": "*:*, product of:",
"details": [
{
"value": 1.0,
"description": "boost",
"details": []
},
{
"value": 1.0,
"description": "queryNorm",
"details": []
}
]
}
]
}
]
}
}
相关标签: es