(self, indices)
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.
Count number of documents.
Count number of documents .
def count(self, indices):
        """Count number of documents.

        Args:
            indices: List of indices.

        Returns:
            Tuple containing number of documents and size on disk.
        """
        if not indices:
            return 0, 0

        # Make sure that the list of index names is uniq.
        indices = list(set(indices))

        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
def count ( self , indices ) : if not indices : return 0 , 0 # Make sure that the list of index names is uniq. indices = list ( set ( indices ) ) 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