title: objectify query filter by list in entity contains search parameter
body: <p>in an app i have an entity that contains a list of other entities (let's say an event holding a list of assigned employees)</p>
  
  <p>using objectify - i need to find all the events a particular employee is assigned to.</p>
  
  <p>is there a basic way to filter a query if it contains the parameter - kind of the opposite of the query in </p>
  
  <p>... quick pseudocode</p>
  
  <pre><code>findAll(Employee employee) {
    ...
    return ofy.query(Event.class).filter("employees.contains", employee).list();
  }
  </code></pre>
  
  <p>any help would be greatly appreciated</p>
  
  <hr>
  
  <p>i tried just doing filter("employees", employee) after seeing this <a href="http://groups.google.com/group/objectify-appengine/browse_thread/thread/77ba676192c08e20">http://groups.google.com/group/objectify-appengine/browse_thread/thread/77ba676192c08e20</a> - but unfortunately this returns me an empty list</p>
  
  <p>currently i'm doing something really inefficient - going through each event, iterating through the employees and adding them to a new list if it contains the given employee just to have something that works - i know this is not right though</p>
  
  <hr>
  
  <p>let me add one thing,</p>
  
  <p>the above query is not actually what it is, i was just using that because i did not think this would make a difference.</p>
  
  <p>The Employee and Events are in the same entity group with Business as a parent</p>
  
  <p>the actual query i am using is the following</p>
  
  <pre><code>ofy.query(Event.class).ancestor(businessKey).filter("employees", employee).list();
  </code></pre>
  
  <p>unfortunately this is still returning an empty list - does having the ancestor(key) in there mess up the filter?</p>
  
  <hr>
  
  <p>solution, the employees field was not indexed correctly.</p>
  
  <p>I added the datastore-indexes file to create a composite index, but was testing originally on a value that I added before the employees field was indexed, this was something stupid i was doing - simply having an index on the "business" field and the "employees" field fixed everything.  the datastore-indexes file did not appear to be necessary, after deleting it and trying again everything worked fine.</p>