joel-bernstein commented on code in PR #1692:
URL: https://github.com/apache/solr/pull/1692#discussion_r1230325042


##########
solr/core/src/java/org/apache/solr/search/ReRankWeight.java:
##########
@@ -24,24 +24,65 @@
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Rescorer;
 import org.apache.lucene.search.Weight;
+import org.apache.solr.request.SolrRequestInfo;
 
 /** A {@code Weight} used by reranking queries. */
 public class ReRankWeight extends FilterWeight {
 
   private final IndexSearcher searcher;
   private final Rescorer reRankQueryRescorer;
+  private final ReRankScaler reRankScaler;
+  private final ReRankOperator reRankOperator;
 
   public ReRankWeight(
-      Query mainQuery, Rescorer reRankQueryRescorer, IndexSearcher searcher, 
Weight mainWeight)
+      Query mainQuery,
+      Rescorer reRankQueryRescorer,
+      IndexSearcher searcher,
+      Weight mainWeight,
+      ReRankScaler reRankScaler,
+      ReRankOperator reRankOperator)
       throws IOException {
     super(mainQuery, mainWeight);
     this.searcher = searcher;
     this.reRankQueryRescorer = reRankQueryRescorer;
+    this.reRankScaler = reRankScaler;
+    this.reRankOperator = reRankOperator;
   }
 
   @Override
   public Explanation explain(LeafReaderContext context, int doc) throws 
IOException {
     final Explanation mainExplain = in.explain(context, doc);
-    return reRankQueryRescorer.explain(searcher, mainExplain, context.docBase 
+ doc);
+    final Explanation reRankExplain =
+        reRankQueryRescorer.explain(searcher, mainExplain, context.docBase + 
doc);
+    if (reRankScaler.getReRankScalerExplain().reRankScale()) {
+      float reRankScore = reRankExplain.getValue().floatValue();
+      float mainScore = mainExplain.getValue().floatValue();
+      if (reRankScore > 0.0f) {
+        float scaledMainScore =
+            
SolrRequestInfo.getRequestInfo().getResponseBuilder().mainScaleExplain.scale(mainScore);

Review Comment:
   Code removed



-- 
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