multi-valued property query in GAE

Posted by Tim on Stack Overflow See other posts from Stack Overflow or by Tim
Published on 2010-12-10T03:47:00Z Indexed on 2010/12/29 10:54 UTC
Read the original article Hit count: 172

Filed under:
|
|

class Person{ @Persistent private List tags = ArrayList() }

I want to let the user query a person based on his/her tag, so I had my query filter like this:

tags.contains(tagValue1)

and if the user want to search for multiple tags, I would just add to the filter so if the user is searching for 3 tags, then the query would be

tags.contains(tagValue1) && tags.contains(tagValue2) && tags.contains(tagValue3)

I think this approach is wrong, because the datastore then needs to have an index that have the tags property three times... and if the user search for more than 3 tags at a time then it will be broken.

What's the proper way to do this? Do you guys have any suggestions?

© Stack Overflow or respective owner

Related posts about gae-datastore

Related posts about jdo