msokolov commented on a change in pull request #366:
URL: https://github.com/apache/lucene/pull/366#discussion_r727213376



##########
File path: lucene/core/src/test/org/apache/lucene/search/TestKnnVectorQuery.java
##########
@@ -234,10 +235,65 @@ public void testScoreDotProduct() throws IOException {
 
         // test getMaxScore
         assertEquals(0, scorer.getMaxScore(-1), 0);
-        /* maxAtZero = ((2,3) * (1, 1) = 5) / (||2, 3|| * ||1, 1|| = sqrt(26)) 
= 0.5, then
+        /* maxAtZero = ((2,3) * (1, 1) = 5) / (||2, 3|| * ||1, 1|| = 
sqrt(26)), then
          * normalized by (1 + x) /2.
          */
-        float maxAtZero = 0.99029f;
+        float maxAtZero =
+            (float) ((1 + (2 * 1 + 3 * 1) / Math.sqrt((2 * 2 + 3 * 3) * (1 * 1 
+ 1 * 1))) / 2);

Review comment:
       thanks for the cleanup here




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

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