Change on indexed=False to True not realized by DataStorage and query

橙三吉。 提交于 2019-12-10 23:07:30

问题


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:


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).



来源:https://stackoverflow.com/questions/23426602/change-on-indexed-false-to-true-not-realized-by-datastorage-and-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!