def set_filters(query, filters):
    """Put together all filters we have and set them as 'and' filter
    within filtered query.

    :param query: elastic query being constructed
    :param base_filters: all filters set outside of query (eg. resource config, sub_resource_lookup)
    """
    query['query'].setdefault('bool', {})
    if filters:
        for f in filters:
            if f is not None:
                query['query']['bool'].setdefault('filter', []).append(f)
