子查询父
{
"query":{
"has_child":{
"type":"bookContent",
"query":{
"match":{
"currentPageContent":"中心"
}
},
"inner_hits": {}
}
}
}
bookContent 为父亲
“currentPageContent”:“中心” 为条件
父查询子
{
"query": {
"has_parent": {
"parent_type": "book",
"query": {
"match": {
"bookId": 1
}
}
}
}
}
book是父子文档的父
es6X 必须要是parent_type 不能使用type