elasticsearch 哪个子查询与我的复合查询匹配?,elasticsearch,elasticsearch" /> elasticsearch 哪个子查询与我的复合查询匹配?,elasticsearch,elasticsearch" />

elasticsearch 哪个子查询与我的复合查询匹配?

elasticsearch 哪个子查询与我的复合查询匹配?,elasticsearch,elasticsearch,我有一个这样的嵌套查询 { "fields" : ["title","wordCount"], "query":{ "bool":{ "should":[ { "match":{ "title":{ "query": searchTerm, "operator": "and"

我有一个这样的嵌套查询

{  
"fields" : ["title","wordCount"],
"query":{
    "bool":{

            "should":[
        {
            "match":{
                "title":{
                    "query": searchTerm,
                    "operator": "and"    
                }
            }
        },
                {
                    "match_phrase" :{

                        "postHtml":{

                        "query" : searchTerm,
                        "slop" : 1    
                     }

                    }        
                },
                {
                    "match":{
                        "caption" : searchTerm
                    }
                }
            ]
        }
    }
}

有没有办法知道标题或postHtml上是否有匹配项?

您可以将每个查询包装成一个;elasticsearch将返回匹配过滤器的名称

请看一个例子