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
Sampler agg could not be used with Terms agg’s order. #10785
Conversation
@jpountz + @colings86 suggested reviewers if you have the time please :) |
@@ -189,7 +263,7 @@ public void replayRelatedMatches(ScoreDoc[] sd) throws IOException { | |||
if ((rebased >= 0) && (rebased <= maxDocId)) { | |||
currentScore = scoreDoc.score; | |||
currentDocId = rebased; | |||
leafCollector.collect(rebased, 0); | |||
leafCollector.collect(rebased, scoreDoc.shardIndex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a comment here reminding that the shardIndex is being used to store the parent bucket ordinal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do
@markharwood left a couple of small comments |
Rebased on latest master |
private int shardSize; | ||
private PerSegmentCollects perSegCollector; | ||
private int matchedDocs; | ||
private BigArrays bigArrays; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can it be final?
Left some minor comments, otherwise it looks good to me |
@jpountz changed to always return 0 for docCount if no prior collections rather than erroring. |
This is what I meant indeed! LGTM |
Pushed to master in 8c3500a |
The Sampler agg was not capable of collecting samples for more than one parent bucket.
Added a Junit test case and changed BestDocsDeferringCollector to internally maintain collections per parent bucket.
Closes #10719