gpt4 book ai didi

elasticsearch - 为什么_explain返回的文档匹配:_search不返回true?

转载 作者:行者123 更新时间:2023-12-03 02:02:52 24 4
gpt4 key购买 nike

我正在努力解决以下Elasticsearch问题:

使用以下主体获取/myindex/mytype/_search:

{
"query": {
"bool": {
"should": [
{
"prefix": {
"name": "attorneys"
}
},
{
"multi_match": {
"query": "attorneys",
"type": "most_fields",
"fields": [
"name^2",
"description"
]
}
},
{
"nested": {
"boost": 2.0,
"path": "categories",
"score_mode": "sum",
"query": {
"bool": {
"should": [
{
"match": {
"categories.name": {
"fuzziness": 10,
"query": "attorneys"
}
}
},
{
"term": {
"categories.name": "attorneys"
}
}
]
// ...closing brackets trimmed for conciseness

不会返回ID = 10007的文档。

但是,具有完全相同的查询正文的GET /myindex/mytype/10007/_explain返回:

{
"_index": "vendors",
"_type": "vendor",
"_id": "10007",
"matched": true,
"explanation": {
"value": 0.26991397,
"description": "product of:",
"details": [
{
"value": 0.8097419,
"description": "sum of:",
"details": [
{
"value": 0.8097419,
"description": "Score based on child doc range from 304 to 304"
}
]
},
{
"value": 0.33333334,
"description": "coord(1/3)"
}
]
}
}

为什么 _explain返回 "matched": true_query不返回
文件?

最佳答案

您的查询匹配多少个结果?由于您未指定from / size,因此默认值为返回前10个结果。也许文档10007来得晚。

关于elasticsearch - 为什么_explain返回的文档匹配:_search不返回true?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30224865/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com