diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextVectorWriter.java b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextVectorWriter.java index e000daa610c..308bd53dfbe 100644 --- a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextVectorWriter.java +++ b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextVectorWriter.java @@ -80,9 +80,7 @@ public class SimpleTextVectorWriter extends VectorWriter { docIds.add(docV); } long vectorDataLength = vectorData.getFilePointer() - vectorDataOffset; - if (vectorDataLength > 0) { - writeMeta(fieldInfo, vectorDataOffset, vectorDataLength, docIds); - } + writeMeta(fieldInfo, vectorDataOffset, vectorDataLength, docIds); } private void writeVectorValue(VectorValues vectors) throws IOException { diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingVectorFormat.java b/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingVectorFormat.java index bae55293d57..836ebc35bc8 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingVectorFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingVectorFormat.java @@ -91,7 +91,7 @@ public class AssertingVectorFormat extends VectorFormat { VectorValues values = delegate.getVectorValues(field); if (values != null) { assert values.docID() == -1; - assert values.size() > 0; + assert values.size() >= 0; assert values.dimension() > 0; assert values.similarityFunction() != null; }