kaivalnp commented on code in PR #15003:
URL: https://github.com/apache/lucene/pull/15003#discussion_r2528608676


##########
lucene/core/src/java/org/apache/lucene/util/hnsw/IncrementalHnswGraphMerger.java:
##########
@@ -98,7 +111,21 @@ public IncrementalHnswGraphMerger addReader(
         candidateVectorCount = vectorValues.size();
       }
     }
-    graphReaders.add(new GraphReader(reader, docMap, candidateVectorCount));
+
+    GraphReader graphReader = new GraphReader(reader, docMap, 
candidateVectorCount);
+
+    int graphSize = graph.size();
+    int deletePct = ((graphSize - candidateVectorCount) * 100) / graphSize;

Review Comment:
   IIUC, this is attempting to count the percent of deleted vectors in a 
segment? (which will trigger a fresh graph creation if <= 
`DELETE_PCT_THRESHOLD`)
   
   If so, `candidateVectorCount` is populated from `byteVectorValues.size()` / 
`vectorValues.size()` -- which does not incorporate deletes -- we'll need to 
count that separately (like in #15429)



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to