code: def count_index(index=INDEX_NAME):
      
      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']
docs: 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