Pagination and Determining Next Page
TLDR Gustavo asked about pagination and determining the next page. Jason suggested using the
page keys to calculate the total number of pages.
Jun 14, 2023 (6 months ago)
foundkey with the total number of documents across all pages.
pagesearch parameters to determine the total number of pages
per_pageis always the same. One could want to have the first page have fewer items to load faster, and in that case it would involve a bit more math, so a
has_morecould be nice. But your suggestion will work for me.
Indexed 3015 threads (79% resolved)
How to Check Next Page Existence When Paginating
Patrik inquired about checking next page when paginating. Jason suggested using the 'found' field from the response and 'per_page' query value.
Calculating Total Pages in Search Request Results
Laura asked how to calculate total pages of search results. Jason suggested using `found / per_page`.
Pagination of Data with Different Page Sizes
Jameshwart inquires about pagination with different page sizes. Jason advises on pagination using 'per_page', 'found', and 'modulo'. Kishore Nallan suggests using 'offset' and 'limit' for flexible pagination.