Skip to content

[EE5/6] Search module should use results parameter when pagination isn't applied #1862

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

Closed
PaulBaileyAtChan opened this issue Mar 1, 2022 · 1 comment · Fixed by #2757 or #3046
Closed

Comments

@PaulBaileyAtChan
Copy link

When results aren't paginated, the search module is hard-coded to return at most 100 hits (see below), and the results parameter is ignored.

There's no good reason for this. In cases where pagination isn't being applied, it would make sense to use the existing results parameter as a maximum. A hard-coded default if the results parameter isn't present would make sense, but the results parameter should override this — whether larger or smaller than the default.

Screen Shot 2022-03-01 at 11 56 15 AM

@PaulBaileyAtChan
Copy link
Author

To add a bit of flesh here: my own use-case is that I'm taking search results from simple search, and post-processing to present them in a more user-friendly way. Because of how I'm doing this, I have no need for pagination. But if I don't use pagination, the maximum number of results I can have is fixed in the code at 100. So my only option to increase this limit is to hack the EE code — which I'd rather not do, for obvious reasons.

My tentative suggestion is:

Screen Shot 2022-04-13 at 6 30 42 PM

This picks up the limit from the results parameter, even if pagination isn't being used. I believe this is robust, because $pagination->per_page is given a sensible default if the results parameter isn't present.

This might be an obscure use-case, but I can't see any obvious issues with the proposed change. Providing access to the results limit using the results parameter, rather than fixing the limit in code, just makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants