'Delete index if it\'s there and creates a new one.
:arg es: ES to use. By default, this creates a new indexing ES.
:arg index: The Index object to use.'

def recreate_index(self, es=None, index=None):

    cls = WikiDocumentType
    if (es is None):
        es = cls.get_connection()
    if (index is None):
        index = self.get_current()
    index.delete_if_exists()
    try:
        es.indices.create(index.prefixed_name, body=cls.get_settings())
    except RequestError:
        pass
