Change on indexed=False to True not realized by Da

2019-07-20 17:42发布

Inside my model I had a property that was set to indexed=False. To use it in a projection I had to change this to indexed=True. But surprisingly now doing a query does not give a single result, always empty. Any hint to reindex the table or why the result set is empty?

https://developers.google.com/appengine/docs/python/ndb/properties#options

1条回答
▲ chillily
2楼-- · 2019-07-20 18:03

For data that was saved before you changed indexed from False to True, any indexes will not include that property. You need to save each of your entities again to re-index them with the property now included in the index.

Depending on the size of your dataset, you can do this in a request handler (100s of entities), a taskqueue (1000s of entities), or using a MapReduce job (10000+ entities).

查看更多
登录 后发表回答