multi-valued property query in GAE
- by Tim
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?