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?
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.
I had to specify index.yaml
when deploying.
gcloud app deploy app.yaml index.yaml