jpountz commented on code in PR #13641:
URL: https://github.com/apache/lucene/pull/13641#discussion_r1755048948


##########
lucene/core/src/java/org/apache/lucene/codecs/KnnVectorsWriter.java:
##########
@@ -212,14 +213,34 @@ private static void validateFieldEncoding(FieldInfo 
fieldInfo, VectorEncoding ex
       }
     }
 
+    /**
+     * Returns true if the fieldInfos has vector values for the field.
+     *
+     * @param fieldInfos fieldInfos for the segment
+     * @param fieldName field name
+     * @return true if the fieldInfos has vector values for the field.
+     */
+    public static boolean hasVectorValues(FieldInfos fieldInfos, String 
fieldName) {
+      return fieldInfos != null
+          && fieldInfos.hasVectorValues()
+          && fieldInfos.fieldInfo(fieldName) != null
+          && fieldInfos.fieldInfo(fieldName).hasVectorValues();

Review Comment:
   nit: let's only do the by-name lookup once?



##########
lucene/core/src/java/org/apache/lucene/codecs/KnnVectorsWriter.java:
##########
@@ -212,14 +213,34 @@ private static void validateFieldEncoding(FieldInfo 
fieldInfo, VectorEncoding ex
       }
     }
 
+    /**
+     * Returns true if the fieldInfos has vector values for the field.
+     *
+     * @param fieldInfos fieldInfos for the segment
+     * @param fieldName field name
+     * @return true if the fieldInfos has vector values for the field.
+     */
+    public static boolean hasVectorValues(FieldInfos fieldInfos, String 
fieldName) {
+      return fieldInfos != null

Review Comment:
   nit: FieldInfos should never be null



##########
lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextKnnVectorsFormat.java:
##########
@@ -41,4 +41,14 @@ public void testRandomBytes() throws Exception {
   public void testSortedIndexBytes() throws Exception {
     // unimplemented
   }
+
+  @Override
+  public void testMergingWithDifferentKnnFields() {
+    // unimplemented
+  }
+
+  @Override
+  public void testMergingWithDifferentByteKnnFields() {
+    // unimplemented
+  }

Review Comment:
   I'm not clear why SimpleText (and some other codecs) needs to disable these 
tests?



##########
lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseKnnVectorsFormatTestCase.java:
##########
@@ -230,6 +236,108 @@ public void testIllegalDimChangeTwoWriters() throws 
Exception {
     }
   }
 
+  @SuppressWarnings("unused")

Review Comment:
   why do we need this suppresswarnings annotation?



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