elasticsearch query for selecting records where agent1 is one of the agents but there are also other agents

I have an elasticsearch index that has this fields: user_id, agent_name, city, ...

I want to run a query for selecting records where agent_name "agent1" is one of the agents but there are also other agents, and then select those that their agents are in more than 2 cities.

I used this query:

query = {

"size": 0,  # Don't need the actual documents, just the aggregation results

"query": {

        {"match": {agent_name: 'agent1'}

},

"aggs": {

    "user_ids": {

        "terms": {"field": "user_id", "size": 60000},

        "aggs": {

            "city_count": {"cardinality": {"field": "city"}}

        }

    }

},

}

in above example if i run the query it first of all, selects records that just all of agent_name values is 'agent1', then aggregates the result, this way i get the result if agent1 is active in 2 cities, but i want it to select a record if one of it's agent is 'agent1' and also have other agents other than agent1, how should I change 'query' part to get desired result?

Not sure I fully understood the use case.

You want a query which matches if agent is agent1 or agent is whoever?

Or agent is agent1 but there are other agents as well? Meaning that the agent is not alone?

I have this fields: customer_id, agent_name, city, ..
assume an insurance company that agents call to customers for marketing,
customers are moving to different cities, and city of customer at the calling time is recorded in my index.
I want a query to get other agents that called 'customer1', if 'agent1' called 'customer1' and if the city of resulted records is different from 'agent1' and 'customer1' city