Handle custom limit in query parameter #111
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #110.
Related to origo-map/origo#1413 and origo-map/origo#1418.
The limit on the number of search hits returned now follows the same behaviour in the following handlers:
The maximum number of hits returned by Origo Server is controlled solely in dbconfig.js. A more specific limit will take precedence over a more general limit:
module.exports.models.search.search.tables[0].limit
>module.exports.models.search.search.limit
>module.exports.limit
If the request url includes the new
&limit={max no of hits}
parameter, this parameter's value will be used only if it is lower than that set in dbconfig.js.If there is no limit set at all, either in dbconfig.js or as a url parameter, then 100 hits is the maximum (same as before).
A special note: I added limit handling for the oracledefault.js db model to make it behave similarly to pgdefault.js and mssqldefault.js. I also removed the limit parameters that was being sent to the db models.
pg
andmssql
(so not consistent)