java - 创建搜索索引 GAE 地理空间查询的权限被拒绝

标签 java android google-app-engine geospatial google-cloud-datastore

我已经包含 Geoespacial 查询来检查 GeoPt 是否在圆内,并且我已经为它创建了一个索引。 当我尝试将其部署到 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>

最佳答案

Datastore 的地理空间搜索是一个 Alpha release目前已达到容量。查看错误,您似乎不属于 Alpha 计划。

敬请期待对所有人开放的测试版!

关于java - 创建搜索索引 GAE 地理空间查询的权限被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35167767/

相关文章:

java - 自动服务发现协议(protocol)

android - 发送间隔 2 秒的多个 "Toast"

java - Google App Engine Java - javax.servlet 源文件

android - 使用 Google Cloud/Android Mobile Backend Starter 上的 Kind Name 访问范围

java - 正则表达式背诵

java - 我如何在 Maven 中结合 WAR 打包和 OSGi 包创建?

java - 高度可扩展的 Java Web 应用程序的最佳 UI 框架

连接 Activity 的 Android 最佳实践

java - NoClassDefFoundError : com/squareup/javapoet/TypeName when including library

java - 运行示例代码时找不到 URL