cpoerschke commented on code in PR #2348:
URL: https://github.com/apache/solr/pull/2348#discussion_r1530235435


##########
solr/core/src/java/org/apache/solr/search/ReRankCollector.java:
##########
@@ -128,22 +128,26 @@ public TopDocs topDocs(int start, int howMany) {
       }
 
       ScoreDoc[] mainScoreDocs = mainDocs.scoreDocs;
-      ScoreDoc[] mainScoreDocsClone =
-          (reRankScaler != null && reRankScaler.scaleScores())
-              ? deepCloneAndZeroOut(mainScoreDocs)
-              : null;
+      boolean zeroOutScores = reRankScaler != null && 
reRankScaler.scaleScores();
+      ScoreDoc[] mainScoreDocsClone = deepClone(mainScoreDocs, zeroOutScores);
       ScoreDoc[] reRankScoreDocs = new ScoreDoc[Math.min(mainScoreDocs.length, 
reRankDocs)];
       System.arraycopy(mainScoreDocs, 0, reRankScoreDocs, 0, 
reRankScoreDocs.length);
 
       mainDocs.scoreDocs = reRankScoreDocs;
 
       // If we're scaling scores use the replace rescorer because we just want 
the re-rank score.
-      TopDocs rescoredDocs =
-          reRankScaler != null && reRankScaler.scaleScores()
-              ? reRankScaler
-                  .getReplaceRescorer()
-                  .rescore(searcher, mainDocs, mainDocs.scoreDocs.length)
-              : reRankQueryRescorer.rescore(searcher, mainDocs, 
mainDocs.scoreDocs.length);
+      TopDocs rescoredDocs;
+      try {
+        rescoredDocs =
+            reRankScaler != null && reRankScaler.scaleScores()

Review Comment:
   ```suggestion
               zeroOutScores // previously zero-ed out scores are to be replaced
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to