File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments