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

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

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


##########
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:
   Personally I don't find including this number helpful -- we don't usually include any query details within explanations. Storing 'k' in `DocAndScoreQuery` also felt out of place, since it's only used in these messages and has no bearing on the query's functionality (not included in equals/ hashCode, etc.)
   
   I don't feel strongly though, happy to undo this part. Or we could switch the message to "not in top k nearest neighbors" to make it clearer?



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