{
"size": 0,
"query": {
"bool": {
"filter": [
{
"term": {
"is_reachable": {
"value": "YES",
"boost": 1
}
}
},
{
"exists": {
"field": "user_id",
"boost": 1
}
},
{
"terms": {
"account_type": [
"LEAD"
],
"boost": 1
}
}
],
"must_not": [
{
"exists": {
"field": "customer_on",
"boost": 1
}
},
{
"nested": {
"query": {
"bool": {
"filter": [
{
"bool": {
"should": [
{
"terms": {
"customer_business_relations.country_iso": [
"AE"
],
"boost": 1
}
},
{
"terms": {
"customer_business_relations.branch_id": [
11385
],
"boost": 1
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
{
"terms": {
"customer_business_relations.account_type": [
"LEAD"
],
"boost": 1
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"path": "customer_business_relations",
"ignore_unmapped": false,
"score_mode": "none",
"boost": 1
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"aggregations": {
"ACCOUNT_TYPE": {
"terms": {
"field": "account_type",
"size": 5,
"min_doc_count": 1,
"shard_min_doc_count": 0,
"show_term_doc_count_error": false,
"order": [
{
"_count": "desc"
},
{
"_key": "asc"
}
]
}
},
"PHONE": {
"filter": {
"term": {
"has_phone": {
"value": "true",
"boost": 1
}
}
}
},
"REACHABLE_PHONES": {
"filter": {
"term": {
"is_phone_reachable": {
"value": "true",
"boost": 1
}
}
}
},
"EMAIL": {
"filter": {
"term": {
"has_email": {
"value": "true",
"boost": 1
}
}
}
},
"REACHABLE_EMAILS": {
"filter": {
"term": {
"is_email_reachable": {
"value": "true",
"boost": 1
}
}
}
},
"UNDELIVERED_NESTED_MAPPINGS": {
"nested": {
"path": "undelivered_communications"
},
"aggregations": {
"UNDELIVERED_COMMUNICATION": {
"terms": {
"field": "undelivered_communications.channel",
"size": 5,
"min_doc_count": 1,
"shard_min_doc_count": 0,
"show_term_doc_count_error": false,
"order": [
{
"_count": "desc"
},
{
"_key": "asc"
}
]
}
}
}
}
}
}
in the must_not part i have two condition inside should . if any one condition true count must be increased .but count is not getting increased