【发布时间】:2016-05-12 02:27:00
【问题描述】:
我已经包含了地理空间查询来检查 GeoPt 是否在 Circle 内,并且我已经为它创建了一个索引。 当我尝试将其部署到 GAE 时,出现以下错误:
Creating an index failed for entity_type: "MyEntity" ancestor: falseProperty { name: "name"}Property { name: "location" mode: 3}: Permission denied for creating a search index
这是我正在执行的代码
GeoPt center = new GeoPt((float) pLatitude, (float) pLongitude);
double radius = pDistanceKM*1000;
Query.Filter f = new StContainsFilter("location", new Circle(center, radius));
items = ofy().load().type(MyEntity.class).filter(f).filter("name", tmpName).list();
我已经根据documentation创建了一个索引:
这是我的索引:
<datastore-index kind="MyEntity" source="manual">
<property name="name" />
<property name="location" mode="geospatial"/>
</datastore-index>
有人知道这个权限是什么吗?
使用 Java 和 Android Studio。
Ps:当我尝试执行代码时,GAE 中的 Logging 建议我使用与我的索引相同的索引
com.google.api.server.spi.SystemService invokeServiceMethod: exception occurred while calling backend method com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found. The suggested index for this query is:
<datastore-index kind="MyEntity" source="manual">
<property name="name" />
<property name="location" mode="geospatial"/>
</datastore-index>
【问题讨论】:
标签: java android google-app-engine geospatial google-cloud-datastore