@classmethod
def process_filters(cls, query, filters):
    """Process filters and update the query.

    query: dict
    filters: dict

    return dict.
    """
    if filters.get('must') or filters.get('must_not') or filters.get(
        'must_or_should'):
        query = {'bool': {}}
        if filters.get('must'):
            query['bool']['must'] = [{'bool': {'must': filters['must']}}]
        if filters.get('must_not'):
            if not query['bool'].get('must'):
                query['bool']['must'] = []
            query['bool']['must'].append({'bool': {'must_not': filters[
                'must_not']}})
        if filters.get('must_or_should'):
            if not query['bool'].get('must'):
                query['bool']['must'] = []
            query['bool']['must'].append({'bool': {'should': filters[
                'must_or_should']}})
    return query
