def nested(path, query, *args, **kwargs):
    """
    Creates a nested query for use with nested documents

    Keyword arguments such as score_mode and others can be added.
    """
    nested = {
        "path": path,
        "query": query
    }
    nested.update(kwargs)
    return {
        "nested": nested
    }