stephen-woods commented on code in PR #2506:
URL: https://github.com/apache/solr/pull/2506#discussion_r1638116683
##########
solr/core/src/test/org/apache/solr/search/RankQueryTest.java:
##########
@@ -106,4 +119,65 @@ public void testPluggableCollector() {
"//result/doc[2]/str[@name='id'][.='6']",
"//result/doc[1]/str[@name='id'][.='5']");
}
+
+ // The following static classes are intended to ensure that support of
covariant
+ // ScoreDocs is supported in rank queries. MyRankQuery will fail to compile
+ // if covariant ScoreDocs are not supported because it returns a
TopDocsCollector
+ // for MyScoreDoc (a subtype of ScoreDoc).
+ static class MyScoreDoc extends ScoreDoc {
+ public int someOtherField = 0;
Review Comment:
Oh, I thought you wanted it final because I didn't expose it originally in
the constructor. It's fine in this test example, but in practice, it would need
to remain mutable so that the `ScoreDoc` can be reused and changed within a
`PriorityQueue` - none of the other fields in `ScoreDoc` are final.
--
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]