{
"query": {
"bool": {
"must": [
{ "nested": {
"path": "tags",
"query": {
"bool": {
"must": [
{ "match": { "tags.name": "Apple"} },
{ "range": { "tags.count": { "gte": 4 } } },
]
}
}
}},
{ "nested": {
"path": "tags",
"query": {
"bool": {
"must": [
{ "match": { "tags.name": "Cake"} },
{ "range": { "tags.count": { "gte": 3 } } }
]
}
}
}}
]
}
}
bool queries are evaluated against a single doc, so, you probably need to pull up conditions.