I use memcache and datastore indexes with the google search api in gae. A practical problem is how to refresh a datastore index after an entity has been deleted since it appears that the entity is still in the index though it has been deleted. And how should I handle a more hypothetical scenario if memcache and the index start contain very different contents for the "same" data set i.e. a list of entities that can display from memcache, from the datastore index or from a datastore roundtrip?
For the first problem, I would recommend using the entity's key as doc_id for the index and since you have a reference to the document, you can delete it in a pre_delete_hook. This way you can also keep the data up to date, needed since adding a new document with an existing doc_id to the index will result in overwriting the existing one. (e.g. having a post_put_hook that creates the corresponding search document) For the second, it's probably better to make sure that you won't run into this kind of a situation than trying to remedy it by keeping them updated.