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

Fixed incorrect document order for nested aggregations in hybrid query #956

Conversation

martin-gaievski
Copy link
Member

@martin-gaievski martin-gaievski commented Oct 22, 2024

Description

Fixed logic for getting scorers for sub-queries of hybrid query. Today we're getting document ids and scorers from a pre-sorted collection of doc iterators, but that does not work for deeply nested aggregations because that order can change dynamically.

I have added an integ test for this scenario, it will for 2.15.

Related Issues

#955

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@martin-gaievski martin-gaievski changed the title Fixed logic for getting scorers for sub queries in HQ Fixed incorrect document order for nested aggregations in hybrid query Oct 22, 2024
@martin-gaievski martin-gaievski force-pushed the fix_nested_aggregations_in_hybrid_query branch from 8126196 to e232396 Compare October 22, 2024 18:15
@@ -3,6 +3,8 @@

Compatible with OpenSearch 2.18.0

### Bug Fixes
- Fixed incorrect document order for nested aggregations in hybrid query ([#956](https://github.com/opensearch-project/neural-search/pull/956))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put in release notes file directly because notes were pulled from CHANGELOG for 2.18 release

@martin-gaievski martin-gaievski added skip-changelog bug Something isn't working backport 2.x Label will add auto workflow to backport PR to 2.x branch backport 2.18 labels Oct 22, 2024
@martin-gaievski martin-gaievski marked this pull request as ready for review October 22, 2024 18:25
@martin-gaievski martin-gaievski force-pushed the fix_nested_aggregations_in_hybrid_query branch 2 times, most recently from 7b2fa98 to 2f7ec2f Compare October 22, 2024 19:03
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
Copy link
Member

@vibrantvarun vibrantvarun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks

@martin-gaievski martin-gaievski merged commit 0df59c6 into opensearch-project:main Oct 22, 2024
37 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-956-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 0df59c6ec8733b86f6c8537b1fabe37c21721242
# Push it to GitHub
git push --set-upstream origin backport/backport-956-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-956-to-2.x.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.18 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.18 2.18
# Navigate to the new working tree
cd .worktrees/backport-2.18
# Create a new branch
git switch --create backport/backport-956-to-2.18
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 0df59c6ec8733b86f6c8537b1fabe37c21721242
# Push it to GitHub
git push --set-upstream origin backport/backport-956-to-2.18
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.18

Then, create a pull request where the base branch is 2.18 and the compare/head branch is backport/backport-956-to-2.18.

martin-gaievski added a commit that referenced this pull request Oct 22, 2024
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
(cherry picked from commit 0df59c6)
martin-gaievski added a commit that referenced this pull request Oct 22, 2024
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
(cherry picked from commit 0df59c6)
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
martin-gaievski added a commit that referenced this pull request Oct 22, 2024
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
(cherry picked from commit 0df59c6)
martin-gaievski added a commit that referenced this pull request Oct 22, 2024
(cherry picked from commit 0df59c6)

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
martin-gaievski added a commit that referenced this pull request Oct 23, 2024
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
(cherry picked from commit 0df59c6)

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Label will add auto workflow to backport PR to 2.x branch backport 2.18 bug Something isn't working skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants