'Filters the given queryset by the given app IDs.
This uses a `should` filter, which is equivalent to an "OR".'

@classmethod
def filter_by_apps(cls, app_ids, queryset=None):

    queryset = (queryset or cls.search())
    app_ids = list(set(app_ids))
    queryset = queryset.filter(Bool(should=[F('terms', id=app_ids)]))
    return queryset[0:len(app_ids)]
