Google App Engine error: NeedIndexError: no matching index found

前端 未结 6 1625
说谎
说谎 2020-12-15 18:33

I\'m having trouble with Google\'s App engine indexes. When running my app via the GoogleAppEngineLauncher, the app is working fine. When deploying the app, I get the follow

6条回答
  •  执笔经年
    2020-12-15 19:25

    I fixed this issue by moving the index that the error says is missing above the auto generate line in the "index.yaml" file.

    In your case the yaml file will look like:

    indexes:
    - kind: Bar
     ancestor: yes
     properties:
     - name: rating
       direction: desc
    
    # AUTOGENERATED
    

    Then all you have to do is update your app then update the indexes, you update the indexes by running the following command.

    appcfg.py [options] update_indexes 
    

    With the directory being the directory relative to your index.yaml file. You should then see that index on your dashboard at https://appengine.google.com/datastore/indexes

    The update will initially be "pending" but after the index says "serving" you will be able to make your query.

提交回复
热议问题