Deletes the index before recreating it.