Eurig Jones
Eurig Jones

Reputation: 8543

Removing field indexes safely

I'm moving the data model of an app engine app to Objectify, and I've noticed that Objectify for it's entities specifies all properties of an entity as unindexed by default, which makes sense to me as it would be quicker on writes and less space would be used up.

But the GAE default (at least when I wrote the app) is to create field endexes on all fields by default, so all my fields are indexed. And there is hundreds of thousands of rows.

I really only need only a small fraction of these fields indexed and I would like to set them as unindexed. I want to set these fields as @Unindexed in objectify, but how can I remove the indexed data already in the datastore?

Upvotes: 2

Views: 267

Answers (1)

stickfigure
stickfigure

Reputation: 13556

To add or remove single-property indexes, change the metadata (add/remove @Index and @Unindex) and then load+save the entities. You may wish to use map/reduce for this.

Upvotes: 3

Related Questions