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

Make maximum results configurable #790

Merged
merged 4 commits into from
Apr 18, 2024
Merged

Conversation

karussell
Copy link
Collaborator

Currently the maximum results for forward and reverse search is both at 50. It might be interesting to reduce this value for forward search (to reduce maximum load) and/or increase this value for reverse search (for broader POI searches).

@lonvia
Copy link
Collaborator

lonvia commented Apr 17, 2024

Do we need to introduce a config file before the number of commandline parameters becomes unmaintainable?

@karussell
Copy link
Collaborator Author

Having good defaults ensures that only a few parameters needs to be used. IMO no need for a config file - at least not yet (?)

request.setLimit(parseInt(webRequest, "limit"));
Integer limit = parseInt(webRequest, "limit");
if(limit != null)
request.setLimit(Integer.max(Integer.min(limit, maxResults), 1));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, style nitpicking: please add a space after 'if' and always curly braces, even for one-liners.

@lonvia lonvia merged commit 6732ccf into komoot:master Apr 18, 2024
4 checks passed
@karussell karussell deleted the config_max_results branch April 18, 2024 10:58
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