From 1f1181a079b559946fbe7a5a6cfdc727820549e4 Mon Sep 17 00:00:00 2001 From: Zhang Chao <80152403@qq.com> Date: Thu, 18 Apr 2024 09:50:40 +0800 Subject: [PATCH] Do not use mock merge policy for TestSimilarity (#13314) --- .../src/test/org/apache/lucene/search/TestSimilarity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java index 73a67daba12..1916efeee0f 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java @@ -60,7 +60,9 @@ public class TestSimilarity extends LuceneTestCase { new RandomIndexWriter( random(), store, - newIndexWriterConfig(new MockAnalyzer(random())).setSimilarity(new SimpleSimilarity())); + newIndexWriterConfig(new MockAnalyzer(random())) + .setSimilarity(new SimpleSimilarity()) + .setMergePolicy(newMergePolicy(random(), false))); Document d1 = new Document(); d1.add(newTextField("field", "a c", Field.Store.YES));