Hi, You can order on properties that are not used in the inequality filter, as long as you order _first_ by the inequality filter property.
So what you can do is: score_query.filter('score_date >', date_diff) score_query.order('-score_date') score_query.order('-score') Then, if you limit the number of results fetched, you should be able to do the rest of the sorting in memory. If you stored the sorted results in memcache and did the query relatively infrequently, it should not be an issue. -Marzia On Sat, Dec 27, 2008 at 10:58 AM, riq <ricardoques...@gmail.com> wrote: > > Hi, > This subject was mentioned in earlier posts. I'm just adding the > "limit" variable to it. > > Basically I'm coding a high score server in GAE, and I would like to > perform queries like this one: > > score_query.filter('score_date >', date_diff) > score_query.order('-score') > score_query.limit(50) > > Where score_date can be -1 day, -1 week, -1 month. > > And what I want to do is to send back the 50 best scores of the day, > or of the week, etc. > > Since in GAE the inequality filter and order must use the same > property, I don't know how to do this. > The game could contain 10.000 scores or more, so I don't want to order > them manually. > > What do you recommend ? What strategy should I use to solve this > problem ? > > also, is it in the GAE roadmap to support inequality filter & order > using different properties ? > > Thanks, > > riq. > > > --~--~---------~--~----~------------~-------~--~----~ 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-appengine@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 -~----------~----~----~----~------~----~------~--~---