#community-help

Avoiding Pagination in Search Results and Fetching Counts

TLDR Jainil asked about avoiding pagination and fetching counts. Jason suggested using export and multi_search endpoints, and setting per_page to 0 for counts.

Powered by Struct AI

3

5
6mo
Solved
Join the chat
Apr 07, 2023 (6 months ago)
Jainil
Photo of md5-bea1e4531665b4608c47d00462429d3a
Jainil
05:01 PM
Is there a way to not paginate the search results?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:09 PM
The export endpoint lets you fetch all results without pagination, but it only supports filter_by and not q parameter

1

05:10
Jason
05:10 PM
If you need to use the q parameter, you could request multiple pages via multi_search endpoint

1

Jainil
Photo of md5-bea1e4531665b4608c47d00462429d3a
Jainil
07:19 PM
Followup question, is there an endpoint to just fetch counts?
Apr 08, 2023 (6 months ago)
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:57 AM
You could set per_page to 0, to just get counts

1