def count(self, indices):
    'Count number of documents.\n\n        Args:\n            indices: List of indices.\n\n        Returns:\n            Tuple containing number of documents and size on disk.\n        '
    if (not indices):
        return (0, 0)
    try:
        es_stats = self.client.indices.stats(index=indices, metric='docs, store')
    except NotFoundError:
        es_logger.error('Unable to count indices (index not found)')
        return (0, 0)
    except RequestError:
        es_logger.error('Unable to count indices (request error)', exc_info=True)
        return (0, 0)
    doc_count_total = es_stats.get('_all', {}).get('primaries', {}).get('docs', {}).get('count', 0)
    doc_bytes_total = es_stats.get('_all', {}).get('primaries', {}).get('store', {}).get('size_in_bytes', 0)
    return (doc_count_total, doc_bytes_total)
Count number of documents.

Args:
    indices: List of indices.

Returns:
    Tuple containing number of documents and size on disk.
def count(self, indices):
    'Count number of documents.\n\n        Args:\n            indices: List of indices.\n\n        Returns:\n            Tuple containing number of documents and size on disk.\n        '
    if (not indices):
        return (0, 0)
    try:
        es_stats = self.client.indices.stats(index=indices, metric='docs, store')
    except NotFoundError:
        es_logger.error('Unable to count indices (index not found)')
        return (0, 0)
    except RequestError:
        es_logger.error('Unable to count indices (request error)', exc_info=True)
        return (0, 0)
    doc_count_total = es_stats.get('_all', {}).get('primaries', {}).get('docs', {}).get('count', 0)
    doc_bytes_total = es_stats.get('_all', {}).get('primaries', {}).get('store', {}).get('size_in_bytes', 0)
    return (doc_count_total, doc_bytes_total)