Monday, February 14, 2011

How to Vacuum Indexes (Java) on App Engine

Note, you need App Engine SDK 1.4.2 or higher.

On Linux:
./appengine-java-sdk/bin/appcfg.sh vacuum_indexes myapp/war

On Windows
appengine-java-sdk\bin\appcfg.cmd vacuum_indexes myapp/war

You need to run this from command line on your local PC. This command deletes all indexes for the app that are not mentioned in the local versions of datastore-indexes.xml and generated/datastore-indexes-auto.xml.

About parameters:

  • appcfg.cmd file is part of GAE SDK and so you have to look for it in the folder where SDK is installed. If you use Eclipse then App Engine plugin is installed under "eclipse\plugins\" folder. There might be several GAE SDK folders in there, so make sure you pick the right version. For example for version 1.4.2 the folder name starts with "com.google.appengine.eclipse.sdkbundle.1.4.2".

  • vacuum_indexes - name of the action.

  • myapp/war  - path to the war folder of your application. You need to specify the full path in there.


 Here is corresponding App Engine doc.

After you execute this command, it's going to ask you if you actually want to delete index or not. See screenshot below. 

[caption id="attachment_100" align="alignnone" width="683" caption="Delete index confirmation"]Delete index confirmation[/caption]

-=Oleg=-

No comments:

Post a Comment