Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete Indexed Full-Text Search in Google App Engine

How to delete indexed full text search in Google App Engine? I want to empty the index at admin console at http://appengine.google.com.

like image 726
JR Galia Avatar asked Sep 11 '12 07:09

JR Galia


1 Answers

The simplest way to start with a new, empty index. I don't believe you can empty it from the console nor interact with it apart from writing queries.

To ignore the old content, just rename your current index in your program to your new index name. The old index will hand around forever however, but you can write a small handler that will clear it of all documents programatically if preferred:

https://developers.google.com/appengine/docs/python/search/overview#Removing_Documents

You can remove documents in an index by specifying the doc_id of one or more documents you wish to remove to the Index.remove() method. To remove a collection of documents, specify the ids_only argument to the Index.list_documents() method .

So just loop around the index, getting all the document ID's then delete them all.

like image 191
Paul Collingwood Avatar answered Oct 15 '22 17:10

Paul Collingwood