Well from the app engine docs they show you how to search for a
substring at the beginning of a string...
db.GqlQuery("SELECT * FROM MyModel WHERE prop >= :1 AND prop < :2",
"abc", u"abc" + u"\ufffd")
This matches every MyModel entity with a string property prop that
begins with the characters abc. The unicode string u"\ufffd"
represents the largest possible Unicode character. When the property
values are sorted in an index, the values that fall in this range are
all of the values that begin with the given prefix.
Of course this won't match substrings in the middle of the string...
for that you may have to write something yourself to create a huge
index of all possible matches..
On Oct 18, 8:10 am, Vibhuti Gupta <[email protected]> wrote:
> Hello
>
> Anyone has any idea about some alternative to 'like' clause. I need to write
> a query where I need to select users having a particular string in their
> username.
>
> Thanks
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.