{
"from": 0,
"query": {
"filtered": {
"query": {
"bool": {
"should": [{
"multi_match": {
"fields": ["title", "categories.Name"],
"query": "chinese",
"tie_breaker": 1,
"type": "most_fields"
}
}]
}
}
}
},
"size": 5
}
此查询对字段title
和categories.Name
执行multi_match。
它会返回一个分数。
我希望看到得分细分。 e.g。
理想地:
{
"_score": 0.3,
"_scoreBreakdown": {
"title": 0.1,
"categories.Name": 0.2
}
}
将explain设置为true的问题是,输出不是机器可读的
"_explanation": {
"value": 1.5284284,
"description": "product of:",
"details": [
{
"value": 4.585285,
"description": "sum of:",
"details": [
{
"value": 4.585285,
"description": "weight(categories.Name:Pizza in 238) [PerFieldSimilarity], result of:",
"details": [
{
"value": 4.585285,
"description": "score(doc=238,freq=1.0), product of:",
"details": [
{
"value": 0.7233293,
"description": "queryWeight, product of:",
"details": [
{
"value": 6.3391395,
"description": "idf(docFreq=2, maxDocs=625)"
},
{
"value": 0.114105284,
"description": "queryNorm"
}
]
},
{
"value": 6.3391395,
"description": "fieldWeight in 238, product of:",
"details": [
{
"value": 1,
"description": "tf(freq=1.0), with freq of:",
"details": [
{
"value": 1,
"description": "termFreq=1.0"
}
]
},
{
"value": 6.3391395,
"description": "idf(docFreq=2, maxDocs=625)"
},
{
"value": 1,
"description": "fieldNorm(doc=238)"
}
]
}
]
}
]
}
]
},
{
"value": 0.33333334,
"description": "coord(1/3)"
}
]
}
所以上面的内容很难分析并用来分配权重。是否有更便于阅读的机器可读格式?