我的映射如下:
{ "a": {
"properties": {
"id": {
"type": "integer"
},
"name_1":{
"type":"keyword"
}
}
},
{ "b": {
"properties": {
"id": {
"type": "integer"
},
"a_id": {
"type": "integer"
},
"name_2":{
"type":"keyword"
}
},
"_parent": {
"type": "a"
}
},
{ "c": {
"properties": {
"id": {
"type": "integer"
},
"a_id": {
"type": "integer"
},
"name_3":{
"type":"keyword"
}
},
"_parent": {
"type": "a"
}
}
}
其中a.id = b.a_id,c.a_id。 a和b 之间有很多关系, 在 a和c
之间一对多现在我想基于字段name_2汇总数据以列出所有name_3和doc_count