Skip to content

Commit 90b7e20

Browse files
committed
address review
1 parent 7f2da98 commit 90b7e20

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregator.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,20 @@ public InternalAggregation buildAggregation(long zeroBucket) throws IOException
104104
final CompositeValuesSource.Collector collector =
105105
array.getLeafCollector(context.ctx, getSecondPassCollector(context.subCollector));
106106
int docID;
107-
DocIdSetIterator docIt = null;
108-
if (needsScores()) {
107+
DocIdSetIterator scorerIt = null;
108+
if (needsScores) {
109109
Scorer scorer = weight.scorer(context.ctx);
110110
// We don't need to check if the scorer is null
111111
// since we are sure that there are documents to replay (docIdSetIterator it not empty).
112-
docIt = scorer.iterator();
112+
scorerIt = scorer.iterator();
113113
context.subCollector.setScorer(scorer);
114114
}
115115
while ((docID = docIdSetIterator.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
116116
if (needsScores) {
117-
if (docIt.docID() < docID) {
118-
docIt.advance(docID);
119-
}
117+
assert scorerIt.docID() < docID;
118+
scorerIt.advance(docID);
120119
// aggregations should only be replayed on matching documents
121-
assert docIt.docID() == docID;
120+
assert scorerIt.docID() == docID;
122121
}
123122
collector.collect(docID);
124123
}

0 commit comments

Comments
 (0)