alessandrobenedetti commented on code in PR #1435:
URL: https://github.com/apache/solr/pull/1435#discussion_r1154188607


##########
solr/core/src/test/org/apache/solr/search/neural/KnnQParserTest.java:
##########
@@ -205,6 +214,31 @@ public void correctVectorField_shouldSearchOnThatField() {
         "//result/doc[3]/str[@name='id'][.='12']");
   }
 
+  @Test
+  public void vectorByteEncodingField_shouldSearchOnThatField() {
+    String vectorToSearch = "[2.0, 2.0, 1.0, 3.0]";
+
+    assertQ(
+        req(CommonParams.Q, "{!knn f=vector_byte_encoding topK=2}" + 
vectorToSearch, "fl", "id"),
+        "//result[@numFound='2']",
+        "//result/doc[1]/str[@name='id'][.='2']",
+        "//result/doc[2]/str[@name='id'][.='3']");
+  }
+
+  @Test
+  public void 
vectorByteEncodingField_shouldNotApproximateQueryVectorValueToIntegerValues() {
+    String vectorToSearch = "[7.9f, 2.9f, 1.9f, 3.9f]";
+
+    // If we consider the vectors with floating values, document 7 has an 
higher score than document
+    // 6.
+    // If instead we take only the integer part, document 6 gets an higher 
score.

Review Comment:
   having various if in the comment make this test difficult to read, where is 
this condition? 



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

Reply via email to