You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "benwtrent (via GitHub)" <gi...@apache.org> on 2023/02/14 20:39:59 UTC

[GitHub] [lucene] benwtrent commented on a diff in pull request #12148: Improve DocAndScoreQuery#toString

benwtrent commented on code in PR #12148:
URL: https://github.com/apache/lucene/pull/12148#discussion_r1106345767


##########
lucene/core/src/java/org/apache/lucene/search/AbstractKnnVectorQuery.java:
##########
@@ -302,9 +298,9 @@ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float bo
         public Explanation explain(LeafReaderContext context, int doc) {
           int found = Arrays.binarySearch(docs, doc + context.docBase);
           if (found < 0) {
-            return Explanation.noMatch("not in top " + k);
+            return Explanation.noMatch("not in top docs");
           }
-          return Explanation.match(scores[found] * boost, "within top " + k);
+          return Explanation.match(scores[found] * boost, "within top docs");

Review Comment:
   I am not sure about this. The purpose of this class is to hold the results from the KNN search. Its explanation should reflect that its the results from a `knn` search for a given `k`.
   
   Is the reason for removing the `k` is simply because its only used in this method? Or that the number of docs matched could be less than `k`?



-- 
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-unsubscribe@lucene.apache.org

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


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