return ofy().load().type( ranker_score.class ).order( "-value" ).limit( N ).list();
Your idea should work as well as anything for retrieving the top N, and you won't need an index because you're only querying for one property. Two thoughts:
- Make sure you use an ancestor query based on the root key in case you ever make a second ranker
- In Code Jam, all the ranker does for us is return the score of the Nth person. The actual information we want is in a totally separate set of objects. So if we want the top N "scoreboard_row" Entities, we just query for scoreboard rows, sorting by score descending. If we want the next N, we ask the ranker for the score of the person in Nth and then query for scoreboard rows, with score <= score(Nth), and sorting by score descending.
--
You received this message because you are subscribed to the Google Groups "Google App Engine Ranklist" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-app-engine-r...@googlegroups.com.
To post to this group, send email to google-app-en...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-app-engine-ranklist.
For more options, visit https://groups.google.com/d/optout.