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 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]