docs: def zero_downtime_index(index_name, index_config):
      """Context manager to create a new index based on a given alias,
      allow the caller to index it, and then point the alias to the new index
  
      Args:
          index_name (str) Name of an alias that should point to the new index
          index_config (dict) Configuration for the new index
  
      Yields: (name) The full name of the new index
      """
      client = indices_client()
      temporary_name = index_name + '_' + str(uuid.uuid4())
      logging.info('creating index with config %s', index_config)
      create_index(temporary_name, index_config, client)
      try:
          yield temporary_name
          atomic_swap(index_name, temporary_name, client)
      except Exception:
          logging.error(
              'deleting temporary index %s due to error:',
              temporary_name,
              exc_info=True
          )
          client.delete(index=temporary_name)