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

Add server configuration option to control the default page size for search #2229

Closed
csandersdev opened this issue Apr 9, 2021 · 1 comment
Assignees

Comments

@csandersdev
Copy link
Contributor

csandersdev commented Apr 9, 2021

Is your feature request related to a problem? Please describe.
When the client does not specify a page count for search the server defaults to a page size of 10 and there is no way to change it.

Describe the solution you'd like
I would like the ability to control the default page size on the server so that it is increased for each request without specifying it in each client request.

Describe alternatives you've considered
If the client wants a different page size, it can provide the _count parameter on each request. We may not always have control of the client code and it would be nice to be able to control default behavior on the server side.

Acceptance Criteria
1.
GIVEN [a configuration property exists in the server config file]
AND [the user has configured the server with a different value than the default]
WHEN [the user searches for any resource without specifying the _count parameter]
THEN [the server uses the page size configured in the server config file]
2.
GIVEN [no page size configuration is specified in the server config file]
WHEN [the user searches for any resource without specifying the _count parameter]
THEN [the server uses the default page size (10)]
3.
GIVEN [a configuration property exists in the server config file]
AND [the user has configured the server with a value larger than the maximum allowed size]
WHEN [the user searches for any resource without specifying the _count parameter]
THEN [the server logs a warning and uses the maximum allowed page size]

csandersdev added a commit to csandersdev/FHIR that referenced this issue Apr 9, 2021
This address LinuxForHealth#2229 by creating a configuration property
fhirServer/core/defaultPageSize that controls the number of records
retrieved by search when no _count parameter is specified in the
request. This parameter honors SearchConstants.MAX_PAGE_SIZE (1000). If
the server configuration specifies a value greater than MAX_PAGE_SIZE, a
warning is logged and MAX_PAGE_SIZE is used. When no configuration
property is specified the previous default
FHIRConstants.FHIR_PAGE_SIZE_DEFAULT (10) will be used.

Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com>
@prb112 prb112 added this to the Sprint 2021-05 milestone Apr 9, 2021
@tbieste
Copy link
Contributor

tbieste commented Apr 12, 2021

I verified the acceptance criteria using a local server, and all 3 criteria work as expected. Closing.

@tbieste tbieste closed this as completed Apr 12, 2021
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

No branches or pull requests

3 participants