Skip to content

[BlockJoin] Add ParentsChildrenBlockJoinQuery to support parent and c… #14728

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 4 commits into from
Jun 13, 2025

Conversation

Jinny-Wang
Copy link
Contributor

@Jinny-Wang Jinny-Wang commented May 28, 2025

#14565

Problem

The current block join query family doesn't support filtering on both parent docs and child docs at the same time while applying a childLimitPerParent.
To do that we either need to use a ToChildBlockJoinQuery combined with another childQuery.
Or use ToParentBlockJoinQuery combined with ParentChildrenBlockJoinQuery (which only takes 1 parent doc id).
More detailed examples and description in #14565

Solution

Introduce a new ParentsChildrenBlockJoinQuery so that it supports one pass scanning on both parent and child docs , applying filter to both parent and child at the same time while supporting a child limit per parent.

Copy link

This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog-check label to it and you will stop receiving this reminder on future updates to the PR.

Copy link

This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog-check label to it and you will stop receiving this reminder on future updates to the PR.

@Jinny-Wang Jinny-Wang force-pushed the jinnyw_block_join_new_query branch from 03117a9 to edbd182 Compare May 30, 2025 00:29
Copy link

This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog-check label to it and you will stop receiving this reminder on future updates to the PR.

@Jinny-Wang Jinny-Wang force-pushed the jinnyw_block_join_new_query branch from edbd182 to 5132163 Compare June 5, 2025 22:32
Copy link

github-actions bot commented Jun 5, 2025

This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog label to it and you will stop receiving this reminder on future updates to the PR.

Copy link

github-actions bot commented Jun 9, 2025

This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog label to it and you will stop receiving this reminder on future updates to the PR.

@github-actions github-actions bot added this to the 11.0.0 milestone Jun 9, 2025
@msfroh
Copy link
Contributor

msfroh commented Jun 10, 2025

@mkhludnev -- you had some comments on the linked issue. Does this approach seem reasonable to you? If so, I'll go ahead and merge it.

Also, we can safely backport this to 10.x. @Jinny-Wang, could you please move the changelog entry to 10.3.0? Thanks!

@github-actions github-actions bot modified the milestones: 11.0.0, 10.3.0 Jun 10, 2025
@mkhludnev
Copy link
Member

mkhludnev commented Jun 11, 2025

@msfroh I still think extending the existing ToChildBlockJoinQuery with this functionality is preferable, at least from a code maintenance standpoint. However, I can't contribute much to this work now, or anytime soon.
I don't want to block progress; I just wanted to express my considerations. Maybe I'm missing something. Please proceed with what you have now.

@msfroh msfroh merged commit 1584c05 into apache:main Jun 13, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants