How to Check Next Page Existence When Paginating
TLDR Patrik inquired about checking next page when paginating. Jason suggested using the 'found' field from the response and 'per_page' query value.
Powered by Struct AI
1
1
3
12mo
Solved
Oct 22, 2022 (12 months ago)
Patrik
Patrik
06:28 PMHi everyone! Is there any way to check if there is next page when paginating? Or only one way is to request next page for example with limit 1? Thank you!
1
Jason
Jason
06:29 PMThere is a field called found in the response which is the total number of results for that query. You can use that and the per_page value you set in the query to get total number of pages.
Patrik
Patrik
06:31 PMAha! great to know, thank you for fast response! Im working with TS second day yet, but really love it! Especially in comparison with ES 💪
1
Typesense
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI
Indexed 2779 threads (79% resolved)
Similar Threads
Pagination and Determining Next Page
Gustavo asked about pagination and determining the next page. Jason suggested using the `found`, `per_page`, and `page` keys to calculate the total number of pages.
4
3mo
Solved
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.
13
2mo
Solved
Calculating Total Pages in Search Request Results
Laura asked how to calculate total pages of search results. Jason suggested using `found / per_page`.
4
4mo
Solved