Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pagination in Google App EngineSearch API

I want to do pagination in google app engine search api using cursors (not offset). the forward pagination is straight forward , the problem is how to implement the backward pagination.

like image 280
Omair Shamshir Avatar asked Feb 04 '14 06:02

Omair Shamshir


1 Answers

I guess you're out of luck when it comes to paging backwards using cursors.

The Search API also supports the use of query cursors. Cursors are another way to indicate the point from which to begin a query, allowing you to continue a search from the end of the previous result set. Using a cursor is generally more efficient than using offsets. However, the Search API doesn't currently support a "reverse cursor" as does the Datastore API, making it more difficult to to implement backward paging. For this reason, the example application uses offsets rather than cursors to paginate its query results. You can find an example using cursors here.

source

like image 74
siebz0r Avatar answered Oct 04 '22 21:10

siebz0r