How to delete a search Index itself

2020-07-10 05:55发布

Search Index has a method to delete a document. https://developers.google.com/appengine/docs/python/search/indexclass (Python) https://developers.google.com/appengine/docs/java/javadoc/com/google/appengine/api/search/Index (java)

But how to delete Index itself?

Empty Index was listed at the Text Search Panel in the Admin Console.

but no button to delete.

2条回答
甜甜的少女心
2楼-- · 2020-07-10 06:48

Since you have tagged gae-search I assume your question refers to an index of the Search API (i.e. full text search service, not NDB/HRD datastore index).

Currently you can only delete the documents in an index, but you can't delete the index itself, e.g. issue 8235 and 8490. This restriction of Search API applies to all languages supported in Google App Engine.

The vacuum_indexes prompts you only for indices in datastore, but I miss something like this for the search service too.

查看更多
来,给爷笑一个
3楼-- · 2020-07-10 06:52

When running a local dev environment with version 1.9.x (and possibly earlier), you can pass this argument to dev_appserver.py to simply clear ALL of them regardless of whether there are documents in them:

--clear_search_indexes [CLEAR_SEARCH_INDEXES]

It doesn't look like there's a way to clear an individual index yet though based on the issue statuses posted above by Ani.

查看更多
登录 后发表回答