When I face such a problem I try to solve them with "synthetic" properties. If you want to be able to find the top ratings from a given timeframe you could concat timestamp+rating and store this into a single property and do a query on this property restricting to a certain timeframe with converting dates to timestamp and doing some > < and sort descending within a single query.
On Jun 9, 4:34 pm, Billy <[email protected]> wrote: > Hi, I'm trying to do a relatively simple query using appengine(1.3.3) > and JDO. Basically I want to obtain the "top 10 ranked entities for > the last year". Assume I have an entity FOO and properties startDate > and rating ...I would normally do this using a query like below: > > select from FOO where startDate >= someDate order by rating desc range > 0,10; > > I understand however that inequality filters must be specified first > in any sort ordering and so this does not work. So the only way I > know to accomplish this is to query for all FOOs where startDate >= > someDate and then sort them in-memory by rating. This could work, but > I anticipate a large amount of data in FOO and so I don't want to load > 10K records into memory to sort them when I really only the top 10 of > them. > > Any other ideas on how to workaround this limitation? Thanks for your > help... -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" 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-java?hl=en.
