jpountz commented on a change in pull request #172: URL: https://github.com/apache/lucene/pull/172#discussion_r646330897
########## File path: lucene/core/src/java/org/apache/lucene/codecs/VectorWriter.java ########## @@ -104,9 +104,12 @@ private void mergeVectors(FieldInfo mergeFieldInfo, final MergeState mergeState) } } } - // Create a new VectorValues by iterating over the sub vectors, mapping the resulting - // docids using docMaps in the mergeState. - if (subs.size() > 0) { + if (subs.size() == 0) { + // all segments being merged have no vectors + writeField(mergeFieldInfo, VectorValues.EMPTY); + } else { + // Create a new VectorValues by iterating over the sub vectors, mapping the resulting + // docids using docMaps in the mergeState. writeField(mergeFieldInfo, new VectorValuesMerger(subs, mergeState)); } Review comment: Would it work if we removed the condition and called `writeField(mergeFieldInfo, new VectorValuesMerger(subs, mergeState));` when subs is empty too? -- 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. 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