DataStorage和查询无法将indexed

DataStorage和查询无法将indexed

本文介绍了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

推荐答案

对于在将索引从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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 15:20