msokolov commented on a change in pull request #172:
URL: https://github.com/apache/lucene/pull/172#discussion_r646834733



##########
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:
       Hmm I observed subs.size() being 0 in this test case - that's exactly 
the problem. I'm not sure what the root cause is there, but perhaps if we made 
this more like doc values in some way we could fix further up.




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

Reply via email to