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


##########
lucene/core/src/java/org/apache/lucene/util/hnsw/IncrementalHnswGraphMerger.java:
##########
@@ -63,41 +62,38 @@ public IncrementalHnswGraphMerger(
 
   /**
    * Adds a reader to the graph merger if it meets the following criteria: 1. 
Does not contain any
-   * deleted docs 2. Is a HnswGraphProvider/PerFieldKnnVectorReader 3. Has the 
most docs of any
-   * previous reader that met the above criteria
+   * deleted docs 2. Is a HnswGraphProvider 3. Has the most docs of any 
previous reader that met the
+   * above criteria
    */
   @Override
   public IncrementalHnswGraphMerger addReader(
       KnnVectorsReader reader, MergeState.DocMap docMap, Bits liveDocs) throws 
IOException {
-    KnnVectorsReader currKnnVectorsReader = reader;
-    if (reader instanceof PerFieldKnnVectorsFormat.FieldsReader 
candidateReader) {
-      currKnnVectorsReader = candidateReader.getFieldReader(fieldInfo.name);
+    if (!noDeletes(liveDocs) || !(reader instanceof HnswGraphProvider)) {

Review Comment:
   > Q: is it truly necessary to check every bit of liveDocs? If we have a 
non-null liveDocs doesn't that imply one of the bits will be zero?
   
   I'd say yes. IMO `null` is only an optimization for the case when all docs 
are live.



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