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

[Star Tree] [Search] Keyword & Numeric Terms Aggregation #17165

Merged
merged 11 commits into from
Mar 4, 2025
Prev Previous commit
Next Next commit
minor refactoring
Signed-off-by: Sandesh Kumar <[email protected]>
sandeshkr419 committed Mar 3, 2025
commit 6767b399b35a047e82becef8c41355bdd515fb64
Original file line number Diff line number Diff line change
@@ -291,10 +291,11 @@ private boolean subAggsNeedScore() {

@Override
protected boolean shouldDefer(Aggregator aggregator) {
// don't defer when StarTreeContext is set, don't defer when collectMode == SubAggCollectionMode.BREADTH_FIRST
// this boolean condition can be further simplified but affects readability.
return (context.getQueryShardContext().getStarTreeQueryContext() == null || collectMode != SubAggCollectionMode.BREADTH_FIRST)
&& collectMode == SubAggCollectionMode.BREADTH_FIRST
&& !aggsUsedForSorting.contains(aggregator);
if (context.getQueryShardContext().getStarTreeQueryContext() == null) {
return collectMode == SubAggCollectionMode.BREADTH_FIRST && !aggsUsedForSorting.contains(aggregator);
} else {
// when pre-computing using star-tree - return false (don't defer) for BREADTH_FIRST case
return collectMode != SubAggCollectionMode.BREADTH_FIRST;
}
}
}