Google app engine 在基于Android Studio的项目中为AppEngine创建复合索引

Google app engine 在基于Android Studio的项目中为AppEngine创建复合索引,google-app-engine,android-studio,google-cloud-endpoints,google-cloud-datastore,objectify,Google App Engine,Android Studio,Google Cloud Endpoints,Google Cloud Datastore,Objectify,我使用androidstudio创建了一个Android项目及其后端AppEngine端点。我有一个使用Objectify的数据存储。这个系统工作得很好,直到我在查询中添加了一个过滤器(只显示特定的电子邮件) 但是,当我尝试测试Google API Explorer时,我从中收到这样一个错误: com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found. The suggested

我使用androidstudio创建了一个Android项目及其后端AppEngine端点。我有一个使用Objectify的数据存储。这个系统工作得很好,直到我在查询中添加了一个过滤器(只显示特定的电子邮件)

但是,当我尝试测试Google API Explorer时,我从中收到这样一个错误:

com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found.
The suggested index for this query is:
    <datastore-index kind=\"AccessReport\" ancestor=\"false\" source=\"manual\">
    <property name=\"email\" direction=\"asc\"/>
    <property name=\"when\" direction=\"desc\"/>
    </datastore-index>
com.google.appengine.api.datastore.DatastoreNeedIndexException:未找到匹配的索引。
此查询的建议索引为:
据我所知,我只需要创建一个复合索引,包括特定的字段email和when,以及它们的特定排序方向

然而,我找到的大多数文档都告诉我编辑
数据存储索引.xml

App Engine为实体的每个属性预定义了一个简单索引。一 App Engine应用程序可以在索引中定义更多自定义索引 名为datastore-indexes.xml的配置文件,在中生成 应用程序的/war/WEB-INF/appengine生成目录

不幸的是,这个文件似乎不存在于我的项目中的任何地方


有人熟悉在使用Android Studio时如何更改此设置吗?

创建datastore-indexes.xml文件并将其放入
/WEB-INF/
文件夹中。内容如下所示:

<datastore-indexes
  autoGenerate="true">

    <datastore-index kind=\"AccessReport\" ancestor=\"false\" source=\"manual\">
        <property name=\"email\" direction=\"asc\"/>
        <property name=\"when\" direction=\"desc\"/>
    </datastore-index>
</datastore-indexes>


应该在Android Studio项目中的何处创建?您的后端模块应该有一个
WEB-INF
文件夹。这个文件放在那里。太好了,我会看一下。所以在Android Studio中,你必须自己创建这个文件吗?但是在使用Maven的Eclipse中,它会自动生成它吗?请注意,文档当前暗示您可以创建
index.yaml
,但对于基于Java的实现来说,情况并非如此(还没有呢?)
com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found.
The suggested index for this query is:
    <datastore-index kind=\"AccessReport\" ancestor=\"false\" source=\"manual\">
    <property name=\"email\" direction=\"asc\"/>
    <property name=\"when\" direction=\"desc\"/>
    </datastore-index>
<datastore-indexes
  autoGenerate="true">

    <datastore-index kind=\"AccessReport\" ancestor=\"false\" source=\"manual\">
        <property name=\"email\" direction=\"asc\"/>
        <property name=\"when\" direction=\"desc\"/>
    </datastore-index>
</datastore-indexes>