(query, filter_)
return {
        "bool": {
            "filter": [filter_],
            "must": query
        }
    }
Filtered query for performing both filtering and querying at once
Filtered query for performing both filtering and querying at once
Filtered query for performing both filtering and querying at once
def filtered(query, filter_):
    """
    Filtered query for performing both filtering and querying at once
    """
    return {
        "bool": {
            "filter": [filter_],
            "must": query
        }
    }
def filtered ( query , filter_ ) : return { "bool" : { "filter" : [ filter_ ] , "must" : query } }