1
votes

I read the couple threads on SO about paging using app engine and objectify (via cursors), and this link here: https://developers.google.com/appengine/articles/paging

So far all the discussions with cursors have been about just providing a previous/next page. What I want is to generate a list of links for the next page, the 'next+1' page, the 'next+2' page, etc.

The bottom of any google search query has a list of page links https://www.google.co.kr/?gfe_rd=cr&ei=wZ0MVKKLCIrH8geM74DABQ&gws_rd=ssl#newwindow=1&q=paging

I can generate those using limit and offset.. But we know that is inefficient and offset is limited to a value of 1000 max.

So,

1) Am I stuck with just using limit,offset and only providing page links for 1000 entities? So, at 20 results per page, 50 pages, and that's it? Just use 'Next page' thereafter?

2) Should I forget about page links altogether and just use Next/Prev links via cursors?

Appreciate any discussion!

1

1 Answers

1
votes

I believe there is no other option than to page through the complete set and save the cursors at each of the page offsets. This is a one time effort and users clicking the link can then use the cursor to navigate directly to the correct position without incurring the offset cost.

This is only a viable solution if your data set is not changing too often, so your cursors stay valid.