docs: def reindex(self, new_index=None, index_conf=None):
          '''Rebuilt the current index
  
             This function could be useful in the case you want to change some index settings/mappings
             and you don't want to loose all the entries belonging to that index.
  
             This function is built in such a way that you can continue to use the old index name,
             this is achieved using index aliases.
  
             The old index will be cloned into a new one with the given `index_conf`.
             If we are working on an alias, it is redirected to the new index.
             Otherwise a brand new alias with the old index name is created in such a way that
             points to the newly create index.
  
             Keep in mind that even if you can continue to use the same index name,
             the old index will be deleted.
  
             :param index_conf: Configuration to be used in the new index creation.
                                This param will be passed directly to :py:func:`DB.create_index`
          '''
  
          alias = self.index_name if self.es.indices.exists_alias(name=self.index_name) else None
          if alias:
              original_index=self.es.indices.get_alias(self.index_name).popitem()[0]
          else:
              original_index=self.index_name
  
          if new_index is None:
              mtc = re.match(r"^.*_v(\d)*$", original_index)
              if mtc:
                  new_index = original_index[:mtc.start(1)] + str(int(mtc.group(1)) + 1)
              else:
                  new_index = original_index + '_v1'
  
          log.debug("Reindexing {{ alias: '{}', original_index: '{}', new_index: '{}'}}".format(alias, original_index, new_index))
          self.clone_index(new_index, index_conf=index_conf)
  
          if alias:
              log.debug("Moving alias from ['{0}' -> '{1}'] to ['{0}' -> '{2}']".format(alias, original_index, new_index))
              self.es.indices.update_aliases(body={
                  "actions" : [
                      { "remove" : { "alias": alias, "index" : original_index} },
                      { "add" : { "alias": alias, "index" : new_index } }
                  ]})
  
          log.debug("Deleting old index: '{}'".format(original_index))
          self.es.indices.delete(original_index)
  
          if not alias:
              log.debug("Crating new alias: ['{0}' -> '{1}']".format(original_index, new_index))
              self.es.indices.update_aliases(body={
                  "actions" : [
                      { "add" : { "alias": original_index, "index" : new_index } }
                  ]})