You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2025/12/28 18:23:21 UTC

(lucene) branch main updated: Updating createMultiSegmentIndex to utilize an explicit NoMergePolicy (#15523)

This is an automated email from the ASF dual-hosted git repository.

dweiss pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new 309d4a73baf Updating createMultiSegmentIndex to utilize an explicit NoMergePolicy (#15523)
309d4a73baf is described below

commit 309d4a73bafe5f3e68c1e148ed0d7d181be4bee9
Author: Bryce Kane <41...@users.noreply.github.com>
AuthorDate: Sun Dec 28 10:23:15 2025 -0800

    Updating createMultiSegmentIndex to utilize an explicit NoMergePolicy (#15523)
---
 lucene/CHANGES.txt                                                   | 2 ++
 .../core/src/test/org/apache/lucene/index/TestDirectoryReader.java   | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index d08449ef8b7..1c7bffbbc02 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -299,6 +299,8 @@ Bug Fixes
 
 * GITHUB#15478: Fix duplicate neighbor issue by checking node existence before making reverse link. (Pulkit Gupta)
 
+* GITHUB#15523: Updating createMultiSegmentIndex to utilize an explicit NoMergePolicy (Bryce Kane)
+
 Other
 ---------------------
 * GITHUB#15237: Fix SmartChinese to only deserialize dictionary data from classpath with a native array
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
index 5879ee83719..6b346780403 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
@@ -1423,7 +1423,10 @@ public class TestDirectoryReader extends LuceneTestCase {
   }
 
   private void createMultiSegmentIndex(Directory dir, int numSegments) throws IOException {
-    IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig().setMaxBufferedDocs(2));
+    IndexWriter writer =
+        new IndexWriter(
+            dir,
+            newIndexWriterConfig().setMaxBufferedDocs(2).setMergePolicy(NoMergePolicy.INSTANCE));
     for (int i = 0; i < numSegments; i++) {
       Document doc = new Document();
       doc.add(newStringField("id", String.valueOf(i), Field.Store.YES));