def clear_index(index_name):
 index = gae_search.Index(index_name)
 while True:
  doc_ids = [document.doc_id for document in index.get_range(ids_only=True)]
  if (not doc_ids):
   break
  index.delete(doc_ids)

def clear_index ( index_name ) : index = gae_search . Index ( index_name ) while True : doc_ids = [ document . doc_id for document in index . get_range ( ids_only = True ) ] if ( not doc_ids ) : break index . delete ( doc_ids )
clears an index completely .