Well to answer your question, you'd need to regenerate your index, or build it in such a way as items can be removed from it.
My approach to paging was this. I determined for my product I didn't need to offer more than 100 items in a set. When the system that needs paging is first hit, I pull 100 items, and then cache that set using gaeutilities cache. For views after that, I just pull the cache and page through it in blocks of 10. I found that I could reliably pull 100 items, though I have seen one instance in my logs where the deadline error was exceeded. When I add or delete items from that set, I delete the cache and rely on the next view to reinstantiate it. On Jan 28, 11:49 am, kang <[email protected]> wrote: > Then if I delete a object, the numerical index will be broken..How to do > efficient paging? > > > > On Wed, Jan 28, 2009 at 8:08 AM, Marzia Niccolai <[email protected]> wrote: > > > Hi, > > > The efficient method for paging only generates a 'next' and a 'back' > > link when used as written. > > > For numbered pagination, you will need to maintain some kind of global > > counter object that would compute the number of pages and the proper > > filtering value for each page you wanted to display. > > > -Marzia > > > On Wed, Jan 28, 2009 at 10:40 AM, kang <[email protected]> wrote: > > > I still do not know how to do paging...I can only get the next link, but > > I > > > can not get the page 2,3,4,5,6,7,8 more link. Wish you can give me more > > > hint. Thanks > > > > On Mon, Jan 26, 2009 at 7:32 AM, Marzia Niccolai <[email protected]> > > wrote: > > > >> Hi, > > > >> This may not work for your particular use case, but you can use an > > >> equality filter in conjunction with the key filter, so instead of > > >> something like: > > >> suggestions = Suggestion.all().filter('__key__ >=', > > >> bookmark).order("__key__").fetch(PAGESIZE+1) > > >> you could do: > > >> suggestions = Suggestion.all().filter('title =', > > >> VALUE).filter('__key__ >=', > > >> bookmark).order("__key__").fetch(PAGESIZE+1) > > > >> Which would at least allow users to query on a small subset of values > > >> (those that specifically equal a property) and still allow paging on > > >> the results. > > > >> -Marzia > > > >> On Mon, Jan 26, 2009 at 1:02 PM, kang <[email protected]> wrote: > > >> > Thanks for your reply. > > >> > I've just read the article today and I will have a try. For search > > >> > result, I > > >> > do not know what query users give and how much result. So, I can not > > >> > give a > > >> > index for an instance. > > > >> > On Mon, Jan 26, 2009 at 6:54 AM, Marzia Niccolai <[email protected]> > > >> > wrote: > > > >> >> Hi, > > > >> >> There are a couple of reliable ways to do paging with App Engine for > > >> >> arbitrarily sized data sets, both of which are discussed in this > > >> >> article: > > >> >>http://code.google.com/appengine/articles/paging.html > > >> >> And the corresponding sample code: > > >http://code.google.com/p/google-app-engine-samples/source/browse/#svn... > > > >> >> The easiest way is to just use key paging, if key ordering is > > >> >> sufficient for your paging needs. > > > >> >> I'm not sure what you mean by not being able index a search result, > > >> >> but with the paging methods described in the article, deleting an > > >> >> entity should not affect the ability to page. > > > >> >> -Marzia > > > >> >> On Sat, Jan 24, 2009 at 1:02 PM, lookon <[email protected]> > > wrote: > > > >> >> > I've read the discussion about paging and have post some problems. > > >> >> > But > > >> >> > I still have some problems. > > > >> >> > If I builds index by myself, I cannot index the search result. And > > if > > >> >> > I have built index for an object and delete one instance of an > > >> >> > object, > > >> >> > the index will be broken. > > > >> >> > If I use the GAE Paginator class (http://appengine- > > >> >> > cookbook.appspot.com/recipe/gae-paginator-class/? > > > id=ahJhcHBlbmdpbmUtY29va2Jvb2tyjgELEgtSZWNpcGVJbmRleCI4YWhKaGNIQmxibWRwYm1VdFkyOXZhMkp2YjJ0eUZBc1NDRU5oZEdWbmIzSjVJZ1pFYW1GdVoyOE0MCxIGUmVjaXBlIjlhaEpoY0hCbGJtZHBibVV0WTI5dmEySnZiMnR5RkFzU0NFTmhkR1ZuYjNKNUlnWkVhbUZ1WjI4TTcM) > > > >> >> > Then how to deal with the 1000 result limit in GAE? I cannot page > > if > > >> >> > I > > >> >> > have more than 1000 result. I can write my new paging class, but > > wish > > >> >> > you can give me some advice.Thanks. > > > >> > -- > > >> > Stay hungry,Stay foolish. > > > > -- > > > Stay hungry,Stay foolish. > > -- > Stay hungry,Stay foolish. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
