I have a User class and store the user's submitted full name as a single S开发者_开发百科tring:
class User {
private String mFullName;
}
There's no partial string matching available in app engine though. I am looking through current options, looks like the nonrel-search project has come up with a pretty good solution.
I'm using java though. I don't think there's a java port of that project. What are other java users doing?
I'm thinking of just writing user info to a separate MySQL database on account creation, and just hitting that database with a %like% search when users need it (this should be pretty infrequent).
Duplicating user info to a separate MySQL database would be a temporary solution until something comes built-in for app-engine java, but I haven't heard of anything like this on the roadmap.
Any info/ideas would be great!
Thanks
On the python side of things, I've seen one or two full text search implementations mentioned. The way they work is to tokenize the text to be searched and then create App Engine indexes that can be used for queries. I'm not sure if anything comparable has been created for Java at this time.
If you can make do with searches that are equivalent to 'string%' or '%string', it shouldn't be too difficult to make your own index and do a range scan. In the case of '%string', you would want to store the strings to be searched in reverse, e.g., 'gnirts%'.
精彩评论