(path, filter_)
return {
        "nested": {
            "path": path,
            "query": {
                "bool": {
                    "filter": filter_
                }
            }
        }
    }
Query nested documents which normally can't be queried directly
Query nested documents which normally can't be queried directly
Query nested documents which normally can t be queried directly
def nested(path, filter_):
    """Query nested documents which normally can't be queried directly"""
    return {
        "nested": {
            "path": path,
            "query": {
                "bool": {
                    "filter": filter_
                }
            }
        }
    }
def nested ( path , filter_ ) : return { "nested" : { "path" : path , "query" : { "bool" : { "filter" : filter_ } } } }