[google-appengine] Problem with query

2010-10-14 Thread AlexG
Hi @ all,

i have a problem with a query, What I want to do, is to search in a
String[] for keywords.
I use the String.startsWith("a") function.

When I build the qery like this:

select from ... where myArray.startsWith("keyword"), everything works
fine.

But the problem is, when I build a query, where I want to search for
two keywords, the query
doesnt give me results.

Example:

select from ... where myArray.startsWith(keyword1) &&
myArray.stratsWith("keyword2")

I don´t know why this doenst work, maybe somebody can help me??

Thanks.

Greets
Alex

-- 
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-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Problem with query

2010-10-14 Thread Robert Kluin
Hey Alex,
  I am guessing that under the hood App Engine breaks the startsWith
into two filters that looks something like:
 myArray >= "keyword" AND myArray < "keyword" + "z"

 So when you add the second startsWith filter, you get:
 myArray >= "keyword" AND myArray < "keyword" + "z"
 AND myArray >= "otherword" AND myArray < "otherword2" + "z"

  That is not going to work.  You may be able to validate my theory by
making the two keywords the same and seeing if you get results.

Robert





On Thu, Oct 14, 2010 at 03:17, AlexG
 wrote:
> Hi @ all,
>
> i have a problem with a query, What I want to do, is to search in a
> String[] for keywords.
> I use the String.startsWith("a") function.
>
> When I build the qery like this:
>
> select from ... where myArray.startsWith("keyword"), everything works
> fine.
>
> But the problem is, when I build a query, where I want to search for
> two keywords, the query
> doesnt give me results.
>
> Example:
>
> select from ... where myArray.startsWith(keyword1) &&
> myArray.stratsWith("keyword2")
>
> I don´t know why this doenst work, maybe somebody can help me??
>
> Thanks.
>
> Greets
> Alex
>
> --
> 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-appeng...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-appengine+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-appengine?hl=en.
>
>

-- 
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-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.