[英]com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found
I am getting the following exception when I am deploying my APP of Google App Engine server with Objectify, although I have already configured all the indexes of my application. 使用Objectify部署Google App Engine服务器的APP时遇到以下异常,尽管我已经配置了应用程序的所有索引。 Still didn't understand why I am getting this exception, due to this error, I am not able to do anything on this web application. 仍然不明白为什么我会收到此异常,由于此错误,我无法在此Web应用程序上执行任何操作。
Exception in Production Server 生产服务器中的异常
/search
com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found.
The suggested index for this query is:
<datastore-index kind="M_TAXI" ancestor="false" source="manual">
<property name="cityName" direction="asc"/>
<property name="updatedOn" direction="asc"/>
</datastore-index>
datastore.indexes.xml datastore.indexes.xml
<?xml version="1.0" encoding="UTF-8"?>
<datastore-indexes autoGenerate="true">
<datastore-index kind="M_COUNTRY" ancestor="false" source="auto">
<property name="countryCode" direction="asc" />
<property name="countryName" direction="asc" />
<property name="active" direction="asc" />
</datastore-index>
<datastore-index kind="M_CITY" ancestor="false" source="auto">
<property name="countryCode" direction="asc" />
<property name="cityName" direction="asc" />
<property name="cityCode" direction="asc" />
<property name="active" direction="asc" />
</datastore-index>
<datastore-index kind="M_TAXI" ancestor="false" source="auto">
<property name="cityName" direction="asc" />
<property name="supplierUserName" direction="asc" />
<property name="updatedOn" direction="asc" />
<property name="active" direction="asc" />
<property name="countryName" direction="asc" />
</datastore-index>
</datastore-indexes>
Datastore index image snapshot from production server 来自生产服务器的数据存储索引图像快照
The existing M_TAXI is not usable by the query that threw the exception. 抛出异常的查询无法使用现有的M_TAXI。 Please try inserting 请尝试插入
<datastore-index kind="M_TAXI" ancestor="false" source="manual">
<property name="cityName" direction="asc"/>
<property name="updatedOn" direction="asc"/>
</datastore-index>
into datastore.indexes.xml before the </datastore-indexes> end tag and after the other M_TAXI element, and report back what the result was. 在</ datastore-indexes>结束标记之前和之后的另一个M_TAXI元素之前的datastore.indexes.xml中,并报告结果是什么。
You must add these index in your datastore.indexes.xml
您必须在datastore.indexes.xml
添加这些索引
<datastore-index kind="M_TAXI" ancestor="false" source="manual">
<property name="cityName" direction="asc"/>
<property name="updatedOn" direction="asc"/>
</datastore-index>
As Appengine datastore is schemaless, you must need to add seperate indexes for different query. 由于Appengine数据存储区是无架构的,因此您必须为不同的查询添加单独的索引。
Please refer this stackoverflow post . 请参阅此stackoverflow帖子 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.