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.
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.

- 9,053
- 3
- 23
- 36
-
we can do it in development server, but NOT in appengine... :-) – JR Galia Sep 11 '12 at 11:04
-
I've used the linked function to retrieve, delete then recreate records in an index on the production server, if that's what you mean. When working locally I guess the -c flag also clears the index as well as the datastore, as far as I know there is nothing similar for the production server. – Paul Collingwood Sep 11 '12 at 11:07
-
I guess I'm just gonna go with the renaming thing. – Sayo Oladeji Apr 13 '13 at 18:54