Skip to content

Return distinct items from GetMany and SourceMany (#4353) #4400

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

Merged
merged 1 commit into from
Feb 20, 2020

Conversation

russcam
Copy link
Contributor

@russcam russcam commented Feb 20, 2020

This commit fixes a bug where a GetMany or SourceMany API call
with a repeated id would return a cartesian product of id and documents.

  • enumerate only distinct ids when retrieving hits
    or source from GetMany and SourceMany, so that the same id input
    to either will return only a single document per target index.

  • fix a bug in the MultiGetRequestFormatter whereby
    the document index is removed when a request index is specified,
    without checking whether the document index matches the request index.

Fixes #4342

(cherry-picked from commit 8cbc1fe)

This commit fixes a bug where a GetMany or SourceMany API call
with a repeated id would return a cartesian product of id and documents.

- enumerate only distinct ids when retrieving hits
or source from GetMany and SourceMany, so that the same id input
to either will return only a single document per target index.

- fix a bug in the MultiGetRequestFormatter whereby
the document index is removed when a request index is specified,
without checking whether the document index matches the request index.

Fixes #4342

(cherry-picked from commit 8cbc1fe)
@russcam
Copy link
Contributor Author

russcam commented Feb 20, 2020

this is a backport of #4353 to 6.x

@russcam russcam merged commit 163dc20 into 6.x Feb 20, 2020
@russcam russcam deleted the fix/6x/get-many-source-many branch February 20, 2020 07:30
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