(Full)Text Search for list<String> field and multi-language

70 views
Skip to first unread message

Timofey Tatarinov

unread,
Aug 11, 2011, 9:08:11 AM8/11/11
to Google App Engine
Hello,

Is the text(or part of the text) searching on the field with type
List<String> possible, now?

For example, we have class City with next structure:

City {
protected Long id;
protected List<String> names;
protected List<String> nameLocales;
}
Field "names" stores all names of the city for different languages.

And we want to find all cities which name started with "Mo". Results
are "Monte Carlo", "Moscow" and etc. How it can be done?

Also, We interest in your opinion about our approach for
implementation of the multi-language site (database). For the example
above, names is ["Moscow", "Москва", ...], nameLocales is ["en",
"ru", ...]. If user has locale "en" his index will be '1' and cityName
= names[1] ("Moscow").

How do you store and use multi-language data on your site?

Thanks

Robert Kluin

unread,
Aug 12, 2011, 1:54:14 AM8/12/11
to google-a...@googlegroups.com
You'll need to check the docs for the exact data library you're using,
but this is a common problem. Search 'app engine full text search' or
'app engine prefix query' for lots of discussion and workarounds.

They'll boil down to making a query that looks something like:
SELECT * FROM City WHERE name >= "mo" AND name < "mo" + "\ufffd"

Don't forget to case-normalize the field you're searching on.

Robert

> --
> You received this message because you are subscribed to the Google Groups "Google App Engine" group.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
>
>

Timofey Tatarinov

unread,
Aug 12, 2011, 2:30:01 AM8/12/11
to google-a...@googlegroups.com
Thank you, for quick reply
I would like to specify some issues.

1) Did you forget suffix (-s) for field name "name" in query? Is the same behavior of the text search for "String" and "List<String>" field?

2) What does for last element of the query "\ufffd"?

P.S. I'm using Java version of the App Engine SDK.

Thanks

Nadun Kulatunge

unread,
Aug 12, 2011, 5:51:57 AM8/12/11
to google-a...@googlegroups.com
hey click this URL http://adf.ly/29lnM <http://adf.ly/29lnM> it will help you
check in


Thanks

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/YukN_jz-j6YJ.

To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.



--
Bye TC

Robert Kluin

unread,
Aug 12, 2011, 12:11:27 PM8/12/11
to google-a...@googlegroups.com
Hey Tim,
My query was just an example; I must have typed name rather than
names. The '\ufffd' is the "greatest" (last) unicode character. Its
purpose is the same as 'z' here: WHERE name >= 'mo' AND name <
'moz'.


Robert

> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.

> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/YukN_jz-j6YJ.

Reply all
Reply to author
Forward
0 new messages