def _get_count(stats, index):
    """Return the document count for a given index."""
    try:
        return stats['indices'][index]['primaries']['docs']['count']
    except KeyError:
        return -1