diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java b/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java index 09b3e42cb5b..2fac35f6010 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java @@ -539,7 +539,9 @@ public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase { public void testConcurrentIndexCloseSearchAndRefresh() throws Exception { final Directory dir = newFSDirectory(createTempDir()); AtomicReference writerRef = new AtomicReference<>(); - writerRef.set(new IndexWriter(dir, newIndexWriterConfig())); + final MockAnalyzer analyzer = new MockAnalyzer(random()); + analyzer.setMaxTokenLength(IndexWriter.MAX_TERM_LENGTH); + writerRef.set(new IndexWriter(dir, newIndexWriterConfig(analyzer))); AtomicReference mgrRef = new AtomicReference<>(); mgrRef.set(new SearcherManager(writerRef.get(), null)); @@ -561,7 +563,7 @@ public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase { } else { w.rollback(); } - writerRef.set(new IndexWriter(dir, newIndexWriterConfig())); + writerRef.set(new IndexWriter(dir, newIndexWriterConfig(analyzer))); } } docs.close();