diff --git a/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java index c8f3ccc353d..9d72bd0171c 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java @@ -895,7 +895,7 @@ public class TestBinaryDocValuesUpdates extends LuceneTestCase { reader = DirectoryReader.open(writer); } else { // System.out.println("[" + Thread.currentThread().getName() + "] reopen NRT"); - DirectoryReader r2 = DirectoryReader.openIfChanged(reader, writer, true); + DirectoryReader r2 = DirectoryReader.openIfChanged(reader, writer); if (r2 != null) { reader.close(); reader = r2; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java index 6c0064a688b..d858b52fcf3 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java @@ -2000,7 +2000,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase { } // Trigger writeLiveDocs + writeFieldUpdates so we hit fake exc: - IndexReader r = w.getReader(true); + IndexReader r = w.getReader(); // Sometimes we will make it here (we only randomly // throw the exc): diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterNRTIsCurrent.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterNRTIsCurrent.java index 207b170aba2..afcb07c697c 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterNRTIsCurrent.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterNRTIsCurrent.java @@ -93,7 +93,7 @@ public class TestIndexWriterNRTIsCurrent extends LuceneTestCase { Document doc = new Document(); doc.add(new TextField("id", "1", Field.Store.NO)); writer.addDocument(doc); - holder.reader = currentReader = writer.getReader(true); + holder.reader = currentReader = writer.getReader(); Term term = new Term("id"); for (int i = 0; i < numOps && !holder.stop; i++) { float nextOp = random.nextFloat(); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java index 35128291317..c566b1c220a 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java @@ -1062,7 +1062,7 @@ public class TestIndexWriterReader extends LuceneTestCase { // Deletes nothing in reality...: w.deleteDocuments(new Term("foo", "bar")); - DirectoryReader r5 = DirectoryReader.openIfChanged(r3, w, true); + DirectoryReader r5 = DirectoryReader.openIfChanged(r3, w); assertNull(r5); r3.close(); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMixedDocValuesUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestMixedDocValuesUpdates.java index da9fdca23fa..6d9e3ee1f8d 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestMixedDocValuesUpdates.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestMixedDocValuesUpdates.java @@ -226,7 +226,7 @@ public class TestMixedDocValuesUpdates extends LuceneTestCase { reader = DirectoryReader.open(writer); } else { // System.out.println("[" + Thread.currentThread().getName() + "] reopen NRT"); - DirectoryReader r2 = DirectoryReader.openIfChanged(reader, writer, true); + DirectoryReader r2 = DirectoryReader.openIfChanged(reader, writer); if (r2 != null) { reader.close(); reader = r2; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java index 47e26ef7184..1fb2206b98e 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java @@ -979,7 +979,7 @@ public class TestNumericDocValuesUpdates extends LuceneTestCase { reader = DirectoryReader.open(writer); } else { // System.out.println("[" + Thread.currentThread().getName() + "] reopen NRT"); - DirectoryReader r2 = DirectoryReader.openIfChanged(reader, writer, true); + DirectoryReader r2 = DirectoryReader.openIfChanged(reader, writer); if (r2 != null) { reader.close(); reader = r2; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java b/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java index 6691638285c..b6cc489750a 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java @@ -141,12 +141,12 @@ public class TestStressNRT extends LuceneTestCase { if (VERBOSE) { System.out.println("TEST: " + Thread.currentThread().getName() + ": call writer.getReader"); } - newReader = writer.getReader(true); + newReader = writer.getReader(); } else { if (VERBOSE) { System.out.println("TEST: " + Thread.currentThread().getName() + ": reopen reader=" + oldReader + " version=" + version); } - newReader = DirectoryReader.openIfChanged(oldReader, writer.w, true); + newReader = DirectoryReader.openIfChanged(oldReader, writer.w); } } else { // assertU(commit()); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTryDelete.java b/lucene/core/src/test/org/apache/lucene/index/TestTryDelete.java index be72d1a786a..b6df55f0081 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTryDelete.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTryDelete.java @@ -77,7 +77,6 @@ public class TestTryDelete extends LuceneTestCase IndexWriter writer = getWriter(directory); ReferenceManager mgr = new SearcherManager(writer, - true, new SearcherFactory()); TrackingIndexWriter mgrWriter = new TrackingIndexWriter(writer); @@ -125,7 +124,6 @@ public class TestTryDelete extends LuceneTestCase IndexWriter writer = getWriter(directory); ReferenceManager mgr = new SearcherManager(writer, - true, new SearcherFactory()); IndexSearcher searcher = mgr.acquire(); @@ -169,7 +167,6 @@ public class TestTryDelete extends LuceneTestCase IndexWriter writer = getWriter(directory); ReferenceManager mgr = new SearcherManager(writer, - true, new SearcherFactory()); IndexSearcher searcher = mgr.acquire(); diff --git a/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java b/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java index 126d8c7ab7c..2e1f385bbc9 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java @@ -232,7 +232,7 @@ public class TestControlledRealTimeReopenThread extends ThreadedIndexingAndSearc }; nrtNoDeletes = new SearcherManager(writer, false, sf); - nrtDeletes = new SearcherManager(writer, true, sf); + nrtDeletes = new SearcherManager(writer, sf); nrtDeletesThread = new ControlledRealTimeReopenThread<>(genWriter, nrtDeletes, maxReopenSec, minReopenSec); nrtDeletesThread.setName("NRTDeletes Reopen Thread"); @@ -437,7 +437,7 @@ public class TestControlledRealTimeReopenThread extends ThreadedIndexingAndSearc Directory dir = newDirectory(); IndexWriter iw = new IndexWriter(dir, new IndexWriterConfig(null)); final AtomicBoolean afterRefreshCalled = new AtomicBoolean(false); - SearcherManager sm = new SearcherManager(iw, true, new SearcherFactory()); + SearcherManager sm = new SearcherManager(iw, new SearcherFactory()); sm.addListener(new ReferenceManager.RefreshListener() { @Override public void beforeRefresh() { @@ -484,7 +484,7 @@ public class TestControlledRealTimeReopenThread extends ThreadedIndexingAndSearc config.setIndexDeletionPolicy(sdp); config.setOpenMode(IndexWriterConfig.OpenMode.CREATE_OR_APPEND); final IndexWriter iw = new IndexWriter(dir, config); - SearcherManager sm = new SearcherManager(iw, true, new SearcherFactory()); + SearcherManager sm = new SearcherManager(iw, new SearcherFactory()); final TrackingIndexWriter tiw = new TrackingIndexWriter(iw); ControlledRealTimeReopenThread controlledRealTimeReopenThread = new ControlledRealTimeReopenThread<>(tiw, sm, maxStaleSecs, 0); diff --git a/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java b/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java index 614a6e9221e..0ddd6aa2a57 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java @@ -48,7 +48,7 @@ public class TestLiveFieldValues extends LuceneTestCase { final IndexWriter w = new IndexWriter(dir, iwc); - final SearcherManager mgr = new SearcherManager(w, true, new SearcherFactory() { + final SearcherManager mgr = new SearcherManager(w, new SearcherFactory() { @Override public IndexSearcher newSearcher(IndexReader r, IndexReader previous) { return new IndexSearcher(r); 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 05b25a4560d..76b56a56ba8 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java @@ -89,7 +89,7 @@ public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase { // TODO: can we randomize the applyAllDeletes? But // somehow for final searcher we must apply // deletes... - mgr = new SearcherManager(writer, true, factory); + mgr = new SearcherManager(writer, factory); isNRT = true; } else { // SearcherManager needs to see empty commit: diff --git a/lucene/sandbox/src/test/org/apache/lucene/codecs/idversion/TestIDVersionPostingsFormat.java b/lucene/sandbox/src/test/org/apache/lucene/codecs/idversion/TestIDVersionPostingsFormat.java index 498fde67c9c..5a7a3d617f6 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/codecs/idversion/TestIDVersionPostingsFormat.java +++ b/lucene/sandbox/src/test/org/apache/lucene/codecs/idversion/TestIDVersionPostingsFormat.java @@ -269,7 +269,7 @@ public class TestIDVersionPostingsFormat extends LuceneTestCase { } IndexReader r = w.getReader(); - //IndexReader r = DirectoryReader.open(w, true); + //IndexReader r = DirectoryReader.open(w); PerThreadVersionPKLookup lookup = new PerThreadVersionPKLookup(r, "id"); List> idValuesList = new ArrayList<>(idValues.entrySet()); @@ -655,7 +655,7 @@ public class TestIDVersionPostingsFormat extends LuceneTestCase { final AtomicLong nextVersion = new AtomicLong(); - final SearcherManager mgr = new SearcherManager(w.w, true, new SearcherFactory()); + final SearcherManager mgr = new SearcherManager(w.w, new SearcherFactory()); final Long missingValue = -1L; diff --git a/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPoint.java b/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPoint.java index 3a3a31f439a..0b7a5de39d7 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPoint.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPoint.java @@ -109,7 +109,7 @@ public class TestGeo3DPoint extends LuceneTestCase { Document doc = new Document(); doc.add(new Geo3DPoint("field", PlanetModel.WGS84, toRadians(50.7345267), toRadians(-97.5303555))); w.addDocument(doc); - IndexReader r = DirectoryReader.open(w, true); + IndexReader r = DirectoryReader.open(w); // We can't wrap with "exotic" readers because the query must see the BKD3DDVFormat: IndexSearcher s = newSearcher(r, false); assertEquals(1, s.search(new PointInGeo3DShapeQuery(PlanetModel.WGS84, @@ -678,7 +678,7 @@ public class TestGeo3DPoint extends LuceneTestCase { if (random().nextBoolean()) { w.forceMerge(1); } - final IndexReader r = DirectoryReader.open(w, true); + final IndexReader r = DirectoryReader.open(w); w.close(); // We can't wrap with "exotic" readers because the geo3d query must see the Geo3DDVFormat: diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java index c55bdac8822..5aaabbdc888 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java @@ -219,7 +219,7 @@ public class AnalyzingInfixSuggester extends Lookup implements Closeable { // Already built; open it: writer = new IndexWriter(dir, getIndexWriterConfig(getGramAnalyzer(), IndexWriterConfig.OpenMode.APPEND)); - searcherMgr = new SearcherManager(writer, true, null); + searcherMgr = new SearcherManager(writer, null); } } @@ -281,7 +281,7 @@ public class AnalyzingInfixSuggester extends Lookup implements Closeable { if (commitOnBuild) { commit(); } - searcherMgr = new SearcherManager(writer, true, null); + searcherMgr = new SearcherManager(writer, null); success = true; } finally { if (success == false && writer != null) { @@ -329,7 +329,7 @@ public class AnalyzingInfixSuggester extends Lookup implements Closeable { } writer = new IndexWriter(dir, getIndexWriterConfig(getGramAnalyzer(), IndexWriterConfig.OpenMode.CREATE)); - searcherMgr = new SearcherManager(writer, true, null); + searcherMgr = new SearcherManager(writer, null); } } diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/ShardSearchingTestBase.java b/lucene/test-framework/src/java/org/apache/lucene/search/ShardSearchingTestBase.java index 9d60a1b3ef6..ed7def5886f 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/ShardSearchingTestBase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/search/ShardSearchingTestBase.java @@ -461,7 +461,7 @@ public abstract class ShardSearchingTestBase extends LuceneTestCase { iwc.setInfoStream(new PrintStreamInfoStream(System.out)); } writer = new IndexWriter(dir, iwc); - mgr = new SearcherManager(writer, true, null); + mgr = new SearcherManager(writer, null); searchers = new SearcherLifetimeManager(); // Init w/ 0s... caller above will do initial diff --git a/lucene/test-framework/src/test/org/apache/lucene/codecs/compressing/TestCompressingStoredFieldsFormat.java b/lucene/test-framework/src/test/org/apache/lucene/codecs/compressing/TestCompressingStoredFieldsFormat.java index 93e23cb5270..d416f8ad96f 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/codecs/compressing/TestCompressingStoredFieldsFormat.java +++ b/lucene/test-framework/src/test/org/apache/lucene/codecs/compressing/TestCompressingStoredFieldsFormat.java @@ -287,7 +287,7 @@ public class TestCompressingStoredFieldsFormat extends BaseStoredFieldsFormatTes // by this test. iwConf.setCodec(CompressingCodec.randomInstance(random(), 4*1024, 100, false, 8)); IndexWriter iw = new IndexWriter(dir, iwConf); - DirectoryReader ir = DirectoryReader.open(iw, true); + DirectoryReader ir = DirectoryReader.open(iw); for (int i = 0; i < 5; i++) { Document doc = new Document(); doc.add(new StoredField("text", "not very long at all"));