duanju8431 2017-10-29 04:51
浏览 35
已采纳

如何解决“找不到匹配的索引。”错误

I created a sample app guestbook-foo in App Engine.

It works fine in localhost:8080, but when I deploy the project, I get a "no matching index found." error.

API error 4 (datastore_v3: NEED_INDEX): no matching index found. recommended index is:
- kind: Greeting
  ancestor: yes
  properties:
  - name: Date
    direction: desc

In the project directory there is a index.yaml

indexes:
- kind: Greeting
  ancestor: yes
  properties:
  - name: Date
    direction: desc

I think I must upload the index file to the server. But I couldn't find out where I should specify the file. How can I configure gcloud app deploy option? Or is there another way to configure it?

  • 写回答

2条回答 默认 最新

  • doujiu7704 2017-10-29 09:47
    关注

    ironsand is right, you can use gcloud app deploy app.yaml index.yaml when the indexes were not uploaded directly.

    However, you should always check first if they are being updated or not because sometimes it takes a while for Datastore to build the indexes. To check for this go to the App Engine console > Datastore > Indexes and check if the index in being built. If it is still building, this error will keep occurring until the Datastore finishes.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?