如何在不使用GAE的情况下创建复合索引? [英] How can I create composite index without using GAE?
问题描述
我正在使用Go SDK开发Google Cloud Datastore,并遇到GQL查询错误-您的Datastore没有此查询所需的综合索引(开发人员提供)."我知道我需要创建复合索引.但是根据 Google数据存储区文档,它假定该应用程序已作为GAE启动并运行,而在我的情况下,我们在GKE和Go SDK上运行它以与数据存储区配合使用.
I'm working on Google Cloud Datastore with Go SDK, and hitting a GQL query error - "Your Datastore does not have the composite index (developer-supplied) required for this query." I'm aware that I need to create the composite index. But according to Google Datastore document, it assumes that the application is up and running as an GAE, while in my case we run it on GKE and Go SDK to work with Datastore.
所以我的问题是,是否仅需要一个GAE实例来创建复合索引?
So my question is, do I need to have an GAE instance just for creating an composite index?
推荐答案
您不需要GAE实例即可创建索引.
You don't need a GAE instance to create an index.
请参阅文档中您在部署或删除索引"上链接的部分.您需要创建一个index.yaml
文件(有关此页,请参见此页面示例),然后使用 gcloud datastore create-indexes
命令进行部署.
See the section in the doc you linked on "Deploying or deleting indexes". You'll need to create an index.yaml
file (see this page for examples) and then deploy it using the gcloud datastore create-indexes
command.
这篇关于如何在不使用GAE的情况下创建复合索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!