Google app engine 在google app engine上修改/删除数据存储索引

Google app engine 在google app engine上修改/删除数据存储索引,google-app-engine,Google App Engine,我的旧web.xml是 <datastore-index kind="TBL" ancestor="false"> <property name="Col1" direction="asc" /> <property name="Col2" direction="desc" /> <property name="Col3" direction="asc" /> <property name="Col4" d

我的旧web.xml是

<datastore-index kind="TBL" ancestor="false"> 
    <property name="Col1" direction="asc" /> 
    <property name="Col2" direction="desc" />
    <property name="Col3" direction="asc" />
    <property name="Col4" direction="asc" />
    <property name="Col5" direction="asc" />
    <property name="Col6" direction="asc" />
    <property name="Col7" direction="asc" />
    <property name="Col8" direction="asc" />                         
</datastore-index>  
我正在获取第三个索引的未找到索引错误。我想在所有索引中修改col6的方向,并将其设置为“desc”

我该怎么做?或者如何删除索引?
有人吗?

您正在寻找
vacuum\u索引
命令


这将适用于Java和Python应用程序。事实上,Java的appcfg.sh根本不支持这一点,因此如果您正在运行Java应用程序,则需要Python SDK。

我的环境/进程:

  • 我在一个名为“datastore index.xml”的文件中定义和维护(添加、删除等)我的索引
  • 我使用Maven任务“mvn”构建和部署WAR文件 appengine:deploy”
  • 我使用“mvn appengine:deployIndex”任务部署索引
当我运行这些任务时,我的构建生成这个目录“target\appengine staging\WEB-INF\appengine generated”

在此目录中,您将找到一个“index.yaml”文件,其中包含从“datastore index.xml”文件生成的索引

我认为您不能更新索引,只能删除(旧)和添加(新)索引。

现在(2019-02-06)可以通过以下方式完成:

gcloud数据存储索引清理


从Java SDK 1.4.2开始,它可以通过appcfg.sh(不使用Python SDK)完成。它也可以与Go SDK(包括appcfg.py)一起使用。如果丢失了index.yaml,我如何重新创建它?如果为空,则会删除所有索引。
<datastore-index kind="TBL" ancestor="false"> 
    <property name="Col1" direction="asc" /> 
    <property name="Col2" direction="desc" />
    <property name="Col3" direction="asc" />
    <property name="Col4" direction="asc" />
    <property name="Col5" direction="asc" />
    <property name="Col6" direction="desc" />
    <property name="Col7" direction="asc" />
    <property name="Col8" direction="asc" />                         
</datastore-index>  
TBL  
------------
Col2 ▲ , Col1 ▲ , Col6 ▼  
Col4 ▲ , Col1 ▲ , Col6 ▼  
Col5 ▲ , Col8 ▲ , Col1 ▲ , Col6 ▲ => I got error for this index
Col8 ▲ , Col1 ▲ , Col6 ▲   
Col1 ▲ , Col2 ▼ , Col3 ▲ , Col4 ▲ , Col5 ▲ , Col7 ▲ , Col8 ▲ 
Col1 ▲ , Col2 ▼ , Col3 ▲ , Col4 ▲ , Col5 ▲ , Col6 ▼ , Col7 ▲ , Col8 ▲ 
Col1 ▲ , Col7 ▲  
Col1 ▲ , Col6 ▲  
Col1 ▲ , Col6 ▼  
1. Open the Google Cloud SDK Shell, and cd to the directory with the "index.yaml" file.

2. In the shell, type "gcloud datastore indexes cleanup index.yaml"

3. It will prompt you to continue, and it will further notice indexes in the Cloud Datastore, that are not defined in the local "index.yaml" file.

4. Here it will prompt you to delete these indexes.