title: Using multiple filters in Google App Engine Query
body: <p>I am trying to execute a query in <code>App Engine</code>, the sql version of this select query would look like this </p>
  
  <pre><code>"WHERE (personId ="+personId+" AND uploadedDate &gt;"+lastCheckDate+") OR ("+personId ="+personId+" AND updatedDate &gt;"+lastCheckDate+")"
  </code></pre>
  
  <p>in my app engine backend I create multiple filters and use <code>CompositeFilterOperator</code> to combine the filters like this using <code>Objectify</code></p>
  
  <pre><code>Filter f1 = new FilterPredicate("personId", FilterOperator.EQUAL,personId);
  Filter f2 = new FilterPredicate("uploadDate", FilterOperator.GREATER_THAN,lastCheckDate);
  Filter f3 = new FilterPredicate("updatedDate", FilterOperator.GREATER_THAN,lastCheckDate);
  
  Filter final1 = CompositeFilterOperator.and(f1,f2);
  Filter final2 = CompositeFilterOperator.and(f1,f3);
  
  Filter qFilter = CompositeFilterOperator.or(final1,final2);
  Query&lt;CloudRecord&gt; query = ofy().load().type(CloudRecord.class).filter(qFilter).limit(limit);
  </code></pre>
  
  <p>but I get this error when I call it in my android app</p>
  
  <pre><code>com.google.api.client.googleapis.json.GoogleJsonResponseException: 503 Service Unavailable
   {
     "code": 503,
     "errors": [
       {
         "domain": "global",
         "message": "com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found.\nThe suggested index for this query is:\n    &lt;datastore-index kind=\"CloudRecord\" ancestor=\"false\" source=\"manual\"&gt;\n        &lt;property name=\"personId\" direction=\"asc\"/&gt;\n        &lt;property name=\"uploadDate\" direction=\"asc\"/&gt;\n    &lt;/datastore-index&gt;\n\n",
         "reason": "backendError"
       }
     ],
     "message": "com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found.\nThe suggested index for this query is:\n    &lt;datastore-index kind=\"CloudRecord\" ancestor=\"false\" source=\"manual\"&gt;\n        &lt;property name=\"personId\" direction=\"asc\"/&gt;\n        &lt;property name=\"uploadDate\" direction=\"asc\"/&gt;\n    &lt;/datastore-index&gt;\n\n"
   }
  </code></pre>
  
  <p>All those fields are indexed in the class</p>
  
  <pre><code>@Entity public class CloudRecord {
  
      @Id
      Long id;
  
      @Index
      long uploadDate;
      @Index
      long updatedDate;
      @Index
      String personId;
  </code></pre>
  
  <p>I am not sure what I am doing wrong here, I know it is a problem with the filters because if I comment them out the query executes fine. So what am I doing wrong?</p>