Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

normalize pagination parameters and add size limits #1313

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

haarg
Copy link
Member

@haarg haarg commented Nov 5, 2024

Normalize pagination to use page and page_size parameters rather than sometimes from or size.

Add limits to 10000 max results, returning early rather than sending queries to Elasticsearch.

Always accept page and page_size parameters, and pass them around
internally in that order.

Some end points were accepting size rather than page_size. Support both
parameters for these, prioritizing page_size.

The search end points were accepting a from parameter rather than page.
Add support for a page parameter, and convert the from param into the
page as a fallback.
mickeyn
mickeyn previously approved these changes Nov 5, 2024
Paged results are expensive to compute on Elasticsearch. It will refuse
to give results if paged forward far enough.

Limit our pagination and give empty results if paged too deep.
@haarg haarg force-pushed the haarg/normalize-limit-pagination branch from 4814f61 to 453f770 Compare November 5, 2024 09:54
@haarg haarg merged commit 2633bba into master Nov 5, 2024
1 check passed
@haarg haarg deleted the haarg/normalize-limit-pagination branch November 5, 2024 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants