使用 has_child 方式进行查询,符合条件的有37条记录, 但是执行如下却返回3条 get patient/_search
{
"query": {
"has_child": {
"type": "List_Report_Detail",
"query": {
"bool": {
"must": [
{ "term": { "ID": "1" } }
]}
}
}
}
}
{
"query": {
"has_child": {
"type": "List_Report_Detail",
"query": {
"bool": {
"must": [
{ "term": { "ID": "1" } }
]}
}
}
}
}
1 个回复
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自:
就一个条件,你确认父子关系都关联好了。