Q:

elasticsearch - how to aggregate and filter by multiple rows

I have the following data. 

How can I query all countries that have currency 1 and 2?
The country can have multiple rows with the same currency (so count, can't help)

A:

You should filter queries by desired currencies and aggregate them with a term aggregation.
The tricky part is force Elasticsearch to get all possible countries. This can be done using size=0 parameter in terms aggregation
currencies_criteria = [1,2]

elasticsearch_query = {
    "query": {
        "filtered": {
            "filter": {
                "bool": {
                    "must" : [
                        {
                            "term": {"currency" : currencies_criteria}
                        }
                    ]

                }
            }
        }
    },
    "aggs" : {
        "country_count" : {
            "terms" : {
                "field" : "country",
                #https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-approximate-counts
                "size"  : 0
            }
        }
    }
}

You can see the sample execution of this answer in this notebook

