def count(self, q=None, raw=False):
        try:
            _res = self._es.count(index=self._index, doc_type=self._doc_type, body=q)
            return _res if raw else _res['count']
        except NotFoundError:
            return None