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

Support _total with _include and _revinclude #2070

Closed
tbieste opened this issue Mar 11, 2021 · 2 comments
Closed

Support _total with _include and _revinclude #2070

tbieste opened this issue Mar 11, 2021 · 2 comments
Assignees
Labels
P2 Priority 2 - Should Have search showcase Used to Identify End-of-Sprint Demos

Comments

@tbieste
Copy link
Contributor

tbieste commented Mar 11, 2021

Is your feature request related to a problem? Please describe.
In SearchUtil.java we have the following code snippet:

        // Make sure _total is not present with _include and/or _revinclude.
        // TODO: do we really need to forbid this?
        if (queryParameters.containsKey(SearchConstants.TOTAL)) {
            throw SearchExceptionUtil.buildNewInvalidSearchException(
                    "_total search result parameter not supported with _include or _revinclude.");
        }

Since _sort has a similar restriction, #1915, figured enhancing to support this combination can be deferred as well.

Describe the solution you'd like
Need a way to determine the number of matched vs include resource returned by the query when the total resource count is not available due to the countQuery being skipped.

Describe alternatives you've considered
Continue to disable the use of these parameters together.

Additional context
I think there would be a way to determine matchedCount vs includeCount without needing the total count by adding an "includedRsrc" field to the ResourceDTO since the underlying query does use a SORT_ORDER column to ensure included resources are returned after matched resources. The base query would need to be updated to surface the SORT_ORDER (and maybe rename it to INCLUDE_TYPE or something). Then the matchedCount vs includeCount can just be calculated from the returned ResourceDTOs.

@tbieste tbieste added the search label Mar 11, 2021
@tbieste tbieste self-assigned this Mar 25, 2021
@tbieste tbieste added the P2 Priority 2 - Should Have label Mar 25, 2021
@tbieste tbieste added this to the Sprint 2021-04 milestone Mar 25, 2021
tbieste added a commit that referenced this issue Mar 25, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue Mar 25, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
@tbieste
Copy link
Contributor Author

tbieste commented Mar 25, 2021

Due to the implementation of issue #1158, the matchCount and includeCount no longer need to be calcuated from the total count. This issue now should only have to enable the parameters to be used together.

tbieste added a commit that referenced this issue Mar 25, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue Mar 26, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue Mar 26, 2021
Issue #2070 - Support _total with _include and _revinclude
@michaelwschroeder
Copy link
Contributor

I have exercised this functionality on my local development system running the latest codebase, and have verified that it works correctly with both _include and _revinclude searches

@tbieste tbieste added the showcase Used to Identify End-of-Sprint Demos label Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Priority 2 - Should Have search showcase Used to Identify End-of-Sprint Demos
Projects
None yet
Development

No branches or pull requests

2 participants