title: Google App Engine error: NeedIndexError: no matching index found
body: <p>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 following error:</p>
  
  <pre><code>NeedIndexError: no matching index found.
  The suggested index for this query is:
  - kind: Bar
    ancestor: yes
    properties:
    - name: rating
      direction: desc
  </code></pre>
  
  <p>The error is generated after this line of code:</p>
  
  <pre><code> bars = bar_query.fetch(10)
  </code></pre>
  
  <p>Before the above line of code, it reads:</p>
  
  <pre><code>bar_query = Bar.query(ancestor=guestbook_key(guestbook_name)).order(-Bar.rating)
  </code></pre>
  
  <p>My index.yaml file contains the exact "suggested" index below # AUTOGENERATED:</p>
  
  <pre><code>- kind: Bar
    ancestor: yes
    properties:
    - name: rating
      direction: desc
  </code></pre>
  
  <p>Am I maybe missing something? I removed the index.yaml file and deployed the app again (via the command-line) and one less file was uploaded - so the index.yaml file is there. </p>
  
  <p>Everything is working fine locally. I'm working on the latest Mac OSx. The command used for deployment was:</p>
  
  <pre><code>appcfg.py -A app-name --oauth2 update app
  </code></pre>
  
  <p>The datastore I implemented is loosely based on the guestbook tutorial app.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>EDIT:</p>
  
  <p>My ndb.Model is defined as follow:</p>
  
  <pre><code>class Bar(ndb.Model):
      content = ndb.StringProperty(indexed=False)
      lat = ndb.FloatProperty(indexed=False)
      lon = ndb.FloatProperty(indexed=False)
      rating = ndb.IntegerProperty(indexed=True)
      url = ndb.TextProperty(indexed=False)
  </code></pre>