I used db.paginate on a select statement to page search results the same way the existing category pages do, including returning 404 for pages past the end.
- What worked
- db.paginate took a plain select statement and gave the same 404 behavior out of the box, so search pages matched category pages with no extra code.