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


##########
lucene/core/src/java/org/apache/lucene/search/FieldExistsQuery.java:
##########
@@ -277,4 +276,20 @@ private String buildErrorMsg(FieldInfo fieldInfo) {
         + fieldInfo.name
         + "' exists and indexes neither of these data structures";
   }
+
+  private int getVectorValuesSize(FieldInfo fi, LeafReader reader) throws 
IOException {
+    assert fi.name.equals(field);
+    return switch (fi.getVectorEncoding()) {
+      case FLOAT32 -> {
+        FloatVectorValues floatVectorValues = 
reader.getFloatVectorValues(field);
+        assert floatVectorValues != null : "unexpected null float vector 
values";
+        yield floatVectorValues == null ? 0 : floatVectorValues.size();

Review Comment:
   Nit: can you remove the `null` check since vector values should never be 
null? FWIW I added a test case for this here: #13455.



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