alessandrobenedetti commented on a change in pull request #1571:
URL: https://github.com/apache/lucene-solr/pull/1571#discussion_r518269182



##########
File path: solr/contrib/ltr/src/java/org/apache/solr/ltr/LTRRescorer.java
##########
@@ -166,64 +186,77 @@ public void scoreFeatures(IndexSearcher indexSearcher, 
TopDocs firstPassTopDocs,
         docBase = readerContext.docBase;
         scorer = modelWeight.scorer(readerContext);
       }
-      // Scorer for a LTRScoringQuery.ModelWeight should never be null since 
we always have to
-      // call score
-      // even if no feature scorers match, since a model might use that info to
-      // return a
-      // non-zero score. Same applies for the case of advancing a 
LTRScoringQuery.ModelWeight.ModelScorer
-      // past the target
-      // doc since the model algorithm still needs to compute a potentially
-      // non-zero score from blank features.
-      assert (scorer != null);
-      final int targetDoc = docID - docBase;
-      scorer.docID();
-      scorer.iterator().advance(targetDoc);
-
-      scorer.getDocInfo().setOriginalDocScore(hit.score);
-      hit.score = scorer.score();
-      if (hitUpto < topN) {
-        reranked[hitUpto] = hit;
-        // if the heap is not full, maybe I want to log the features for this
-        // document
+      scoreSingleHit(indexSearcher, topN, modelWeight, docBase, hitUpto, hit, 
docID, scoringQuery, scorer, reranked);

Review comment:
       Brilliant observation!




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

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



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

Reply via email to