<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def count_index(index=INDEX_NAME):
 """ Return a document count for the given index. https://elasticsearch-py.readthedocs.io/en/master/api.html#elasticsearch.Elasticsearch.count https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html """

    refresh_index()  # Refresh the index so we can get a correct count

    query = {
        'query': {
            'match_all': {}
        }
    }
    result = es_conn.count(index=index, doc_type=DOC_TYPE, body=query)
    return result['count']