cpoerschke commented on code in PR #13635:
URL: https://github.com/apache/lucene/pull/13635#discussion_r1778468665


##########
lucene/core/src/test/org/apache/lucene/document/TestManyKnnDocs.java:
##########
@@ -46,27 +54,139 @@ public void testLargeSegment() throws Exception {
     mp.setMaxMergeAtOnce(256); // avoid intermediate merges (waste of time 
with HNSW?)
     mp.setSegmentsPerTier(256); // only merge once at the end when we ask
     iwc.setMergePolicy(mp);
-    String fieldName = "field";
-    VectorSimilarityFunction similarityFunction = 
VectorSimilarityFunction.DOT_PRODUCT;
+    VectorSimilarityFunction similarityFunction = 
VectorSimilarityFunction.EUCLIDEAN;
 
-    try (Directory dir = FSDirectory.open(createTempDir("ManyKnnVectorDocs"));
+    try (Directory dir = FSDirectory.open(testDir = 
createTempDir("ManyKnnVectorDocs"));
         IndexWriter iw = new IndexWriter(dir, iwc)) {
 
       int numVectors = 2088992;
-      float[] vector = new float[1];
-      Document doc = new Document();
-      doc.add(new KnnFloatVectorField(fieldName, vector, similarityFunction));
       for (int i = 0; i < numVectors; i++) {
+        float[] vector = new float[128];
+        Document doc = new Document();
         vector[0] = (i % 256);
+        vector[1] = (float) (i / 256.);
+        doc.add(new KnnFloatVectorField("field", vector, similarityFunction));
+        doc.add(new KeywordField("int", "" + i, 
org.apache.lucene.document.Field.Store.YES));
+        doc.add(new StoredField("intValue", i));

Review Comment:
   Could you help me understand this change? `new float[1]` to `new float[128]` 
sort of jumps out.



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