simonw / sfms-history

The sfms-history project
https://sfms-history.vercel.app
6 stars 1 forks source link

Search results pagination #6

Closed simonw closed 2 years ago

simonw commented 2 years ago

I'm going to try implementing a "next" link for search results which uses an encoded token representing the rank and rowid - -2.7057757214143776:5779 - such that the next page can add where (rank, rowid) > (cast(:rank as float), cast(:rowid as integer)).

simonw commented 2 years ago

Implemented it like this:

https://github.com/simonw/sfms-history/blob/d6b60ee44fc5506bfbf78dc7379f05aa6ae62b9b/plugins/index.py#L42-L45