@classmethod
def count(cls, **kwargs):
    """Like search, but only count the number of matches."""
    kwargs.setdefault('params', {})
    kwargs['params'].update({'search_type': 'count'})
    res = cls.search(raw_result=True, **kwargs)
    return res['hits']['total']
