简体   繁体   English

示例应用中的com.google.appengine.api.datastore.DatastoreNeedIndexException错误

[英]com.google.appengine.api.datastore.DatastoreNeedIndexException error in Sample App

Im testing a GAE Modules App . 我正在测试GAE模块应用程序 My application it is very simple and it has not any query to Cloud SQL or anywhere, it is just a helloworld. 我的应用程序非常简单,它对Cloud SQL或任何地方都没有任何查询,它只是一个helloworld。

However, I'm getting the f 但是,我得到了

com.google.appengine.api.datastore.DatastoreNeedIndexException: no mat
    <datastore-index kind="Greeting" ancestor="true" source="manual">
        <property name="date" direction="desc"/>
    </datastore-index>

How could it be possible? 怎么可能呢?

I had developed many times other GAE applications and I have never met with this issue 我开发了许多其他GAE应用程序,但从未遇到过这个问题

Queries need to be indexed or else it won't work. 查询需要建立索引,否则将无法正常工作。 In this case it seems like when you are returning the greetings, you sorted them by date. 在这种情况下,当您返回问候语时,您似乎按日期对它们进行了排序。 Datastore stores data in pre-sorted tables based on the indexed fields of the entity; 数据存储区根据实体的索引字段将数据存储在预先排序的表中; which means if you never indexed "date", there doesn't exist a table where all the greetings are sorted by date. 这意味着,如果您从未索引过“日期”,那么就不会有一个表,其中所有问候语均按日期排序。

All you need is to add that datastore index block to your datastore-indexes.xml in your WEB-INF folder to fix it. 您需要做的就是将该数据存储区索引块添加到WEB-INF文件夹中的datastore-indexes.xml中进行修复。

After adding the index, redeploy and wait about 10 minutes for all your old data to be indexed (it can take longer if you have more data). 添加索引后,重新部署并等待大约10分钟,以便对所有旧数据建立索引(如果您有更多数据,则可能需要更长的时间)。 Try again and it should work now. 再试一次,现在应该可以了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 com.google.appengine.api.datastore.DatastoreNeedIndexException:找不到匹配的索引 - com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found AppEngine ClassNotFoundException:com.google.appengine.api.datastore.DatastoreServiceFactory - AppEngine ClassNotFoundException: com.google.appengine.api.datastore.DatastoreServiceFactory 如何在Google App Engine _ah / api / explorer中创建com.google.appengine.api.datastore.Key对象? - How to create the com.google.appengine.api.datastore.Key object in the Google App Engine _ah/api/explorer? Google App Engine-java.lang.NoClassDefFoundError:com.google.appengine.api.datastore.DatastoreServiceFactory - Google App Engine - java.lang.NoClassDefFoundError: com.google.appengine.api.datastore.DatastoreServiceFactory Google App Engine:java.lang.NoClassDefFoundError:com / google / appengine / api / datastore / Query $ Filter - Google App Engine: java.lang.NoClassDefFoundError: com/google/appengine/api/datastore/Query$Filter 如何将Google App Engine数据存储区中的数据写入com.google.appengine.api.datastore.Text - How do I write data in my Google App Engine Datastore to com.google.appengine.api.datastore.Text com.google.appengine.api.datastore.DatastoreFailureException:意外失败 - com.google.appengine.api.datastore.DatastoreFailureException: Unexpected failure java.lang.NoClassDefFoundError: com/google/appengine/api/datastore/AsyncDatastoreService - java.lang.NoClassDefFoundError: com/google/appengine/api/datastore/AsyncDatastoreService App Engine JDO Persistent类从com.google.appengine.api.datastore.Key迁移到Long - App Engine JDO Persistent class migrate from com.google.appengine.api.datastore.Key to Long 错误:导入com.google.appengine.api.datastore无法解析JPA GAE GWT - Error:The import com.google.appengine.api.datastore cannot be resolved JPA GAE GWT
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM