Google App Engine错误:找不到匹配的索引。 (JAVA) [英] Google App Engine Error: No matching index found. (Java)
本文介绍了Google App Engine错误:找不到匹配的索引。 (JAVA)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在写一个查询,但它总是说找不到匹配的索引。我不知道为什么。我的代码如下:
I am writing a query but it always says "No matching index found". I don't know why. My code is as below:
Query query = pm.newQuery(Classified.class);
query.setFilter("emp_Id == emp");
query.setOrdering("upload_date desc");
query.declareParameters("String emp");
List<Classified> results = (List<Classified>)query.execute(session.getAttribute("emp_Id").toString());
<?xml version="1.0" encoding="utf-8"?>
<datastore-indexes autoGenerate="true">
<datastore-index kind="Classified" ancestor="false">
<property name="emp_Id" direction="asc" />
<property name="category" direction="asc" />
<property name="upload_date" direction="desc" />
</datastore-index>
</datastore-indexes>
我已经添加了上述索引,但没有帮助。
I have added the above index, but it did not help.
推荐答案
我相信您需要配置数据存储索引。您可能已经在Eclipse中为 WEB-INF / appengine-generated / datastore-indexes-auto.xml
生成了一个只需复制到 > WEB-INF / datastore-indexes.xml
并重新部署。
I believe you need to configure a Datastore Index. There's probably one already generated for you in Eclipse at WEB-INF/appengine-generated/datastore-indexes-auto.xml
that you just need to copy to WEB-INF/datastore-indexes.xml
and deploy again.
这篇关于Google App Engine错误:找不到匹配的索引。 (JAVA)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文