Skip to content

Apache Lucene open-source search software

Disable HNSW connectedComponents (#14214) (#14436)

Benjamin Trentd0be1ca0074a
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 60399788ca6..68ced8b4583 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -252,6 +252,8 @@ Bug Fixes
* GITHUB#14320: Fix DirectIOIndexInput seek to not read when position is within buffer (Chris Hegarty)
+* GITHUB#14436: Disable connectedComponents logic in HNSW graph building. Relates to GITHUB#14214, GITHUB#12627, GITHUB#13566. (Ben Trent)
+
Changes in Runtime Behavior
---------------------
* GITHUB#14189: Bump floor segment size to 16MB in TieredMergePolicy and
diff --git a/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java b/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java
index 56f7bc62e44..04bbc7886f2 100644
--- a/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java
+++ b/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java
@@ -440,10 +440,13 @@ public class HnswGraphBuilder implements HnswBuilder {
void finish() throws IOException {
// System.out.println("finish " + frozen);
- connectComponents();
+ // TODO: Connect components can be exceptionally expensive, disabling
+ // see: https://github.com/apache/lucene/issues/14214
+ // connectComponents();
frozen = true;
}
+ @SuppressWarnings("unused")
private void connectComponents() throws IOException {
long start = System.nanoTime();
for (int level = 0; level < hnsw.numLevels(); level++) {