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

Allow clients to request search results without resource contents #2027

Closed
lmsurpre opened this issue Mar 5, 2021 · 4 comments
Closed

Allow clients to request search results without resource contents #2027

lmsurpre opened this issue Mar 5, 2021 · 4 comments
Assignees
Labels
P3 Priority 3 - Nice To Have

Comments

@lmsurpre
Copy link
Member

lmsurpre commented Mar 5, 2021

Is your feature request related to a problem? Please describe.
We already support variants for controlling what comes back from a search:

  • _summary=count will return just the total (with no entries)
  • _summary=true will return SUBSETTED resources with only summary elements
  • _elements=id will return SUBSETTED resources with only required elements (and modifier elements)

However, there is no way to get a list of resources which match the query without getting the resources themselves.

Describe the solution you'd like
Similar to #2026 I was thinking it might be neat to support this behavior through the use of the HTTP Prefer header.

Describe alternatives you've considered
none

Acceptance Criteria

GIVEN a search request
WHEN no Prefer header is passed
THEN the response returns the resource contents in the response entries (spec-compliant)

GIVEN a search request
WHEN Prefer: return=minimal is passed
THEN the response returns no resource bodies in the response entries

GIVEN a search request
WHEN Prefer: return=representation is passed
THEN the response returns the resource contents in the response entries

Additional context
Sister issue for #2026 ...should probably be done together

@lmsurpre lmsurpre changed the title Allow clients to request search results without returning the resource bodies Allow clients to request search results without resource contents Mar 5, 2021
@lmsurpre lmsurpre added the P3 Priority 3 - Nice To Have label Mar 5, 2021
@lmsurpre
Copy link
Member Author

lmsurpre commented May 3, 2021

easiest impl: just don't attach the resources to the response bundle

better impl: avoid the join with the resources table in the jdbc persistence layer

open question: should we return the lastUpdated time somewhere in the search response (in addition to resource id and version that are in fullUrl)?

@lmsurpre
Copy link
Member Author

Implementing this together with or after #2432 could give a nice way to choose the easiest-to-implement-option (no persistence-layer changes outside of 2432) while still having some server-side performance boost.

@lmsurpre
Copy link
Member Author

open question: should we return the lastUpdated time somewhere in the search response (in addition to resource id and version that are in fullUrl)?

/_history is prohibited in the fullUrl for some reason, so the version would need to be communicated elsewhere...probably in the Bundle.entry.response.location as suggested in #2026 for the history api

@punktilious punktilious self-assigned this Dec 20, 2021
punktilious added a commit that referenced this issue Jan 1, 2022
Signed-off-by: Robin Arnold <robin.arnold@ibm.com>
punktilious added a commit that referenced this issue Jan 2, 2022
Signed-off-by: Robin Arnold <robin.arnold@ibm.com>
punktilious added a commit that referenced this issue Jan 3, 2022
Signed-off-by: Robin Arnold <robin.arnold@ibm.com>
punktilious added a commit that referenced this issue Jan 3, 2022
Signed-off-by: Robin Arnold <robin.arnold@ibm.com>
punktilious added a commit that referenced this issue Jan 4, 2022
Signed-off-by: Robin Arnold <robin.arnold@ibm.com>
punktilious added a commit that referenced this issue Jan 13, 2022
Signed-off-by: Robin Arnold <robin.arnold@ibm.com>
lmsurpre added a commit that referenced this issue Jan 14, 2022
Issue #2027 support prefer result=minimal for search requests
@kmbarton423
Copy link
Contributor

Ran a variety of searches including patient compartment with all supported search result parms. Ran with and without the Prefer return= header using settings of minimal, representation, and OperationOutcome. Search results were as expected given the Prefer setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Priority 3 - Nice To Have
Projects
None yet
Development

No branches or pull requests

3 participants