code: def reinit_index(index=INDEX_NAME):
      
      es_conn.indices.delete(index, ignore=404)
  
      try:
          es_conn.indices.create(index, INDEX_SETTINGS.get(index, None))
      except TransportError as e:
          raise Exception('Failed to created index, got: {}'.format(e.error))
docs: Delete and then initialise the given index name
  
      Gets settings if they exist in the mappings module.
  
      https://elasticsearch-py.readthedocs.io/en/master/api.html#elasticsearch.client.IndicesClient.create
      https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html
  
      https://elasticsearch-py.readthedocs.io/en/master/api.html#elasticsearch.client.IndicesClient.delete
      https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html