DataStorage 和查询未实现将 indexed=False 更改为 True [英] Change on indexed=False to True not realized by DataStorage and query

查看:25
本文介绍了DataStorage 和查询未实现将 indexed=False 更改为 True的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的模型中,我有一个设置为 indexed=False 的属性.要在投影中使用它,我必须将其更改为 indexed=True.但令人惊讶的是,现在进行查询不会给出单一结果,总是空的.有什么提示可以重新索引表或为什么结果集为空?

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

推荐答案

对于在将 indexed 从 False 更改为 True 之前保存的数据,任何索引都不会包含该属性.您需要再次保存每个实体,以使用现在包含在索引中的属性重新索引它们.

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.

根据数据集的大小,您可以在请求处理程序(100 多个实体)、任务队列(1000 多个实体)或使用 MapReduce 作业(10000 多个实体)中执行此操作.

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

这篇关于DataStorage 和查询未实现将 indexed=False 更改为 True的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆