I know you are supposed to add @Index to all properties in your entity model to add an index, but what if you forget and there are already live writes of your entity in the datastore?
Is there a way to manually add an index to all those properties via the developers console or some other way?
I found that if you add @Index to your entity and re-deploy the project, all new writes of that entity will have that property indexed. However, all existing writes of that property will not be indexed (and therefore, unsearchable).
Indices are updated when an entity is written to the datastore. To ensure indices are updated for existing entities, one approach is to read every entity and write it right back -- costly, to be sure, but doing it in batches (e.g in scheduled tasks) would work.
You don't mention which language you're using -- I know it's not Python because there's no
@index
there. In Python, when I update index.yaml with new indices and upload it, App Engine takes care of doing the re-indexing for me (it can take quite a while, but, it does "happen on its own").Whatever your favorite language, you could take advantage of that feature of the Python runtime since App Engine allows various modules of an app (which share the same datastore) to be in different languages -- just add a module in Python, reproducing your models in Python's
ndb
, and use index.yaml just as you would if you were doing an all-Python application... that should work just fine, the only difficulty being to "dig inside" whatever layers you're using on top of the datastore (objectify, or whatever) to reverse engineer your models in Python terms.