LUCENE-9992: Update expectations about vectors with no values.

This commit is contained in:
Adrien Grand 2021-06-09 18:59:14 +02:00
parent 465cb17d2b
commit f5e050bd00
2 changed files with 2 additions and 4 deletions

View File

@ -80,10 +80,8 @@ public class SimpleTextVectorWriter extends VectorWriter {
docIds.add(docV);
}
long vectorDataLength = vectorData.getFilePointer() - vectorDataOffset;
if (vectorDataLength > 0) {
writeMeta(fieldInfo, vectorDataOffset, vectorDataLength, docIds);
}
}
private void writeVectorValue(VectorValues vectors) throws IOException {
// write vector value

View File

@ -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;
}