diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java index 20d3532114d..a5b45f70cb3 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java @@ -3081,7 +3081,9 @@ public class TestIndexWriter extends LuceneTestCase { public void testSoftUpdateDocuments() throws IOException { Directory dir = newDirectory(); - IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig().setSoftDeletesField("soft_delete")); + IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig() + .setMergePolicy(NoMergePolicy.INSTANCE) + .setSoftDeletesField("soft_delete")); expectThrows(IllegalArgumentException.class, () -> { writer.softUpdateDocument(null, new Document(), new NumericDocValuesField("soft_delete", 1)); });