code: def create_index(self, mappings_file, delete=True):
          
  
          if self._read_only:
              raise IOError("Cannot write, Connector created as Read Only")
  
          if delete:
              logger.info(self.__log_prefix + " Deleting index " + self._es_index)
              self._es_conn.indices.delete(self._es_index, ignore=[400, 404])
  
          # Read Mapping
          with open(mappings_file) as f:
              mapping = f.read()
  
          self._es_conn.indices.create(self._es_index, body=mapping)
docs: Create a new index.
  
          :param mappings_file: index mappings to be used.
          :param delete: True to delete current index if exists.