lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r1210305 [1/2] - in /lucene/dev/branches/lucene3606: lucene/contrib/highlighter/src/java/org/apache/lucene/search/vectorhighlight/ lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/ lucene/contrib/highlighter/src/test/o...
Date Mon, 05 Dec 2011 01:41:40 GMT
Author: uschindler
Date: Mon Dec  5 01:41:38 2011
New Revision: 1210305

URL: http://svn.apache.org/viewvc?rev=1210305&view=rev
Log:
LUCENE-3606: Clean up IR.open(...) methods to no longer accept readOnly and IndexDeletionPolicy: Core, Contrib, Solr (Modules need fixing, benchmark was broken before, too)

Modified:
    lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java
    lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java
    lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
    lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java
    lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java
    lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragmentsBuilderTest.java
    lucene/dev/branches/lucene3606/lucene/contrib/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java
    lucene/dev/branches/lucene3606/lucene/contrib/misc/src/java/org/apache/lucene/misc/HighFreqTerms.java
    lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java
    lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/index/codecs/appending/TestAppendingCodec.java
    lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java
    lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/index/IndexReader.java
    lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java
    lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/search/SearcherManager.java
    lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/analysis/CollationTestBase.java
    lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/index/RandomIndexWriter.java
    lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/search/QueryUtils.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestAddIndexes.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestAtomicUpdate.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestCrash.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDeletionPolicy.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDirectoryReader.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDocumentWriter.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestFieldsReader.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestFilterIndexReader.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexReader.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterCommit.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterMerging.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterReader.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterUnicode.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestLazyProxSkipping.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestOmitNorms.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestOmitPositions.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestOmitTf.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestParallelReader.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestParallelReaderEmptyIndex.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestParallelTermEnum.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestPayloads.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestRollback.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestSegmentTermDocs.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestSegmentTermEnum.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestSizeBoundedForceMerge.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestStressIndexing.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestSumDocFreq.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestTermVectorsWriter.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestTermdocPerf.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestThreadedForceMerge.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestTransactionRollback.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestTransactions.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/codecs/perfield/TestPerFieldPostingsFormat.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/values/TestDocValuesIndexing.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/search/TestMultiTermQueryRewrites.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/search/spans/TestSpans.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/search/spans/TestSpansAdvanced2.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/store/TestLockFactory.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/store/TestNRTCachingDirectory.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/store/TestRAMDirectory.java
    lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/util/TestFieldCacheSanityChecker.java
    lucene/dev/branches/lucene3606/solr/core/src/java/org/apache/solr/core/StandardIndexReaderFactory.java
    lucene/dev/branches/lucene3606/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
    lucene/dev/branches/lucene3606/solr/core/src/java/org/apache/solr/spelling/FileBasedSpellChecker.java
    lucene/dev/branches/lucene3606/solr/core/src/java/org/apache/solr/spelling/IndexBasedSpellChecker.java
    lucene/dev/branches/lucene3606/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java

Modified: lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java (original)
+++ lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java Mon Dec  5 01:41:38 2011
@@ -58,7 +58,7 @@ public class FieldTermStack {
   //  writer.addDocument( doc );
   //  writer.close();
     
-  //  IndexReader reader = IndexReader.open( dir, true );
+  //  IndexReader reader = IndexReader.open(dir1);
   //  new FieldTermStack( reader, 0, "f", fieldQuery );
   //  reader.close();
   //}

Modified: lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java (original)
+++ lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java Mon Dec  5 01:41:38 2011
@@ -68,7 +68,7 @@ public class HighlighterPhraseTest exten
     } finally {
       indexWriter.close();
     }
-    final IndexReader indexReader = IndexReader.open(directory, true);
+    final IndexReader indexReader = IndexReader.open(directory);
     try {
       assertEquals(1, indexReader.numDocs());
       final IndexSearcher indexSearcher = newSearcher(indexReader);
@@ -116,7 +116,7 @@ public class HighlighterPhraseTest exten
     } finally {
       indexWriter.close();
     }
-    final IndexReader indexReader = IndexReader.open(directory, true);
+    final IndexReader indexReader = IndexReader.open(directory);
     try {
       assertEquals(1, indexReader.numDocs());
       final IndexSearcher indexSearcher = newSearcher(indexReader);
@@ -191,7 +191,7 @@ public class HighlighterPhraseTest exten
     } finally {
       indexWriter.close();
     }
-    final IndexReader indexReader = IndexReader.open(directory, true);
+    final IndexReader indexReader = IndexReader.open(directory);
     try {
       assertEquals(1, indexReader.numDocs());
       final IndexSearcher indexSearcher = newSearcher(indexReader);
@@ -237,7 +237,7 @@ public class HighlighterPhraseTest exten
     } finally {
       indexWriter.close();
     }
-    final IndexReader indexReader = IndexReader.open(directory, true);
+    final IndexReader indexReader = IndexReader.open(directory);
     try {
       assertEquals(1, indexReader.numDocs());
       final IndexSearcher indexSearcher = newSearcher(indexReader);
@@ -281,7 +281,7 @@ public class HighlighterPhraseTest exten
     } finally {
       indexWriter.close();
     }
-    final IndexReader indexReader = IndexReader.open(directory, true);
+    final IndexReader indexReader = IndexReader.open(directory);
     try {
       assertEquals(1, indexReader.numDocs());
       final IndexSearcher indexSearcher = newSearcher(indexReader);

Modified: lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java (original)
+++ lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java Mon Dec  5 01:41:38 2011
@@ -1677,7 +1677,7 @@ public class HighlighterTest extends Bas
    * writer = new IndexWriter(ramDir,bigramAnalyzer , true); Document d = new
    * Document(); Field f = new Field(FIELD_NAME, "java abc def", true, true,
    * true); d.add(f); writer.addDocument(d); writer.close(); IndexReader reader =
-   * IndexReader.open(ramDir, true);
+   * IndexReader.open(ramDir);
    * 
    * IndexSearcher searcher=new IndexSearcher(reader); query =
    * QueryParser.parse("abc", FIELD_NAME, bigramAnalyzer);
@@ -1763,7 +1763,7 @@ public class HighlighterTest extends Bas
     writer.addDocument(doc, analyzer);
     writer.forceMerge(1);
     writer.close();
-    reader = IndexReader.open(ramDir, true);
+    reader = IndexReader.open(ramDir);
     numHighlights = 0;
   }
 

Modified: lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java (original)
+++ lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java Mon Dec  5 01:41:38 2011
@@ -113,7 +113,7 @@ public class TokenSourcesTest extends Lu
     } finally {
       indexWriter.close();
     }
-    final IndexReader indexReader = IndexReader.open(directory, true);
+    final IndexReader indexReader = IndexReader.open(directory);
     try {
       assertEquals(1, indexReader.numDocs());
       final IndexSearcher indexSearcher = newSearcher(indexReader);
@@ -162,7 +162,7 @@ public class TokenSourcesTest extends Lu
     } finally {
       indexWriter.close();
     }
-    final IndexReader indexReader = IndexReader.open(directory, true);
+    final IndexReader indexReader = IndexReader.open(directory);
     try {
       assertEquals(1, indexReader.numDocs());
       final IndexSearcher indexSearcher = newSearcher(indexReader);
@@ -210,7 +210,7 @@ public class TokenSourcesTest extends Lu
     } finally {
       indexWriter.close();
     }
-    final IndexReader indexReader = IndexReader.open(directory, true);
+    final IndexReader indexReader = IndexReader.open(directory);
     try {
       assertEquals(1, indexReader.numDocs());
       final IndexSearcher indexSearcher = newSearcher(indexReader);
@@ -259,7 +259,7 @@ public class TokenSourcesTest extends Lu
     } finally {
       indexWriter.close();
     }
-    final IndexReader indexReader = IndexReader.open(directory, true);
+    final IndexReader indexReader = IndexReader.open(directory);
     try {
       assertEquals(1, indexReader.numDocs());
       final IndexSearcher indexSearcher = newSearcher(indexReader);

Modified: lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java (original)
+++ lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java Mon Dec  5 01:41:38 2011
@@ -364,7 +364,7 @@ public abstract class AbstractTestCase e
     writer.addDocument( doc );
     writer.close();
     if (reader != null) reader.close();
-    reader = IndexReader.open( dir, true );
+    reader = IndexReader.open(dir);
   }
   
   // make 1 doc with multi valued & not analyzed field
@@ -383,7 +383,7 @@ public abstract class AbstractTestCase e
     writer.addDocument( doc );
     writer.close();
     if (reader != null) reader.close();
-    reader = IndexReader.open( dir, true );
+    reader = IndexReader.open(dir);
   }
   
   protected void makeIndexShortMV() throws Exception {

Modified: lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragmentsBuilderTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragmentsBuilderTest.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragmentsBuilderTest.java (original)
+++ lucene/dev/branches/lucene3606/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragmentsBuilderTest.java Mon Dec  5 01:41:38 2011
@@ -147,7 +147,7 @@ public class SimpleFragmentsBuilderTest 
     writer.addDocument( doc );
     writer.close();
     if (reader != null) reader.close();
-    reader = IndexReader.open( dir, true );
+    reader = IndexReader.open(dir);
   }
   
   public void test1StrMV() throws Exception {

Modified: lucene/dev/branches/lucene3606/lucene/contrib/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/contrib/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/contrib/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java (original)
+++ lucene/dev/branches/lucene3606/lucene/contrib/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java Mon Dec  5 01:41:38 2011
@@ -143,7 +143,7 @@ public class MultiPassIndexSplitter {
           System.err.println("Invalid input index - skipping: " + file);
           continue;
         }
-        indexes.add(IndexReader.open(dir, true));
+        indexes.add(IndexReader.open(dir));
       }
     }
     if (outDir == null) {

Modified: lucene/dev/branches/lucene3606/lucene/contrib/misc/src/java/org/apache/lucene/misc/HighFreqTerms.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/contrib/misc/src/java/org/apache/lucene/misc/HighFreqTerms.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/contrib/misc/src/java/org/apache/lucene/misc/HighFreqTerms.java (original)
+++ lucene/dev/branches/lucene3606/lucene/contrib/misc/src/java/org/apache/lucene/misc/HighFreqTerms.java Mon Dec  5 01:41:38 2011
@@ -78,7 +78,7 @@ public class HighFreqTerms {
       }
     }
     
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     TermStats[] terms = getHighFreqTerms(reader, numTerms, field);
     if (!IncludeTermFreqs) {
       //default HighFreqTerms behavior

Modified: lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java (original)
+++ lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java Mon Dec  5 01:41:38 2011
@@ -69,7 +69,7 @@ public class TestIndexSplitter extends L
     String splitSegName = is.infos.info(1).name;
     is.split(destDir, new String[] {splitSegName});
     Directory fsDirDest = newFSDirectory(destDir);
-    IndexReader r = IndexReader.open(fsDirDest, true);
+    IndexReader r = IndexReader.open(fsDirDest);
     assertEquals(50, r.maxDoc());
     r.close();
     fsDirDest.close();
@@ -81,14 +81,14 @@ public class TestIndexSplitter extends L
     IndexSplitter.main(new String[] {dir.getAbsolutePath(), destDir2.getAbsolutePath(), splitSegName});
     assertEquals(4, destDir2.listFiles().length);
     Directory fsDirDest2 = newFSDirectory(destDir2);
-    r = IndexReader.open(fsDirDest2, true);
+    r = IndexReader.open(fsDirDest2);
     assertEquals(50, r.maxDoc());
     r.close();
     fsDirDest2.close();
     
     // now remove the copied segment from src
     IndexSplitter.main(new String[] {dir.getAbsolutePath(), "-d", splitSegName});
-    r = IndexReader.open(fsDir, true);
+    r = IndexReader.open(fsDir);
     assertEquals(2, r.getSequentialSubReaders().length);
     r.close();
     fsDir.close();

Modified: lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/index/codecs/appending/TestAppendingCodec.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/index/codecs/appending/TestAppendingCodec.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/index/codecs/appending/TestAppendingCodec.java (original)
+++ lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/index/codecs/appending/TestAppendingCodec.java Mon Dec  5 01:41:38 2011
@@ -123,7 +123,7 @@ public class TestAppendingCodec extends 
     writer.addDocument(doc);
     writer.forceMerge(1);
     writer.close();
-    IndexReader reader = IndexReader.open(dir, null, true, 1);
+    IndexReader reader = IndexReader.open(dir, 1);
     assertEquals(2, reader.numDocs());
     Document doc2 = reader.document(0);
     assertEquals(text, doc2.get("f"));

Modified: lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java (original)
+++ lucene/dev/branches/lucene3606/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java Mon Dec  5 01:41:38 2011
@@ -43,7 +43,7 @@ public class TestHighFreqTerms extends L
        TEST_VERSION_CURRENT, new MockAnalyzer(random, MockTokenizer.WHITESPACE, false))
        .setMaxBufferedDocs(2));
     indexDocs(writer);
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     _TestUtil.checkIndex(dir);
   }
   

Modified: lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/index/IndexReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/index/IndexReader.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/index/IndexReader.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/index/IndexReader.java Mon Dec  5 01:41:38 2011
@@ -302,21 +302,27 @@ public abstract class IndexReader implem
    * @throws IOException if there is a low-level IO error
    */
   public static IndexReader open(final Directory directory) throws CorruptIndexException, IOException {
-    return open(directory, null, null, true, DEFAULT_TERMS_INDEX_DIVISOR);
+    return open(directory, null, DEFAULT_TERMS_INDEX_DIVISOR);
   }
-
-  /** Returns an IndexReader reading the index in the given
-   *  Directory.  You should pass readOnly=true, since it
-   *  gives much better concurrent performance, unless you
-   *  intend to do write operations (delete documents or
-   *  change norms) with the reader.
+  
+  /** Returns a IndexReader reading the index in the given
+   *  Directory, with readOnly=true.
    * @param directory the index directory
-   * @param readOnly true if no changes (deletions, norms) will be made with this IndexReader
+   * @param termInfosIndexDivisor Subsamples which indexed
+   *  terms are loaded into RAM. This has the same effect as {@link
+   *  IndexWriterConfig#setTermIndexInterval} except that setting
+   *  must be done at indexing time while this setting can be
+   *  set per reader.  When set to N, then one in every
+   *  N*termIndexInterval terms in the index is loaded into
+   *  memory.  By setting this to a value > 1 you can reduce
+   *  memory usage, at the expense of higher latency when
+   *  loading a TermInfo.  The default value is 1.  Set this
+   *  to -1 to skip loading the terms index entirely.
    * @throws CorruptIndexException if the index is corrupt
    * @throws IOException if there is a low-level IO error
    */
-  public static IndexReader open(final Directory directory, boolean readOnly) throws CorruptIndexException, IOException {
-    return open(directory, null, null, readOnly, DEFAULT_TERMS_INDEX_DIVISOR);
+  public static IndexReader open(final Directory directory, int termInfosIndexDivisor) throws CorruptIndexException, IOException {
+    return open(directory, null, termInfosIndexDivisor);
   }
   
   /**
@@ -352,111 +358,12 @@ public abstract class IndexReader implem
    * @throws CorruptIndexException if the index is corrupt
    * @throws IOException if there is a low-level IO error
    */
-  public static IndexReader open(final IndexCommit commit, boolean readOnly) throws CorruptIndexException, IOException {
-    return open(commit.getDirectory(), null, commit, readOnly, DEFAULT_TERMS_INDEX_DIVISOR);
+  public static IndexReader open(final IndexCommit commit) throws CorruptIndexException, IOException {
+    return open(commit.getDirectory(), commit, DEFAULT_TERMS_INDEX_DIVISOR);
   }
 
-  /** Expert: returns an IndexReader reading the index in
-   *  the given Directory, with a custom {@link
-   *  IndexDeletionPolicy}.  You should pass readOnly=true,
-   *  since it gives much better concurrent performance,
-   *  unless you intend to do write operations (delete
-   *  documents or change norms) with the reader.
-   * @param directory the index directory
-   * @param deletionPolicy a custom deletion policy (only used
-   *  if you use this reader to perform deletes or to set
-   *  norms); see {@link IndexWriter} for details.
-   * @param readOnly true if no changes (deletions, norms) will be made with this IndexReader
-   * @throws CorruptIndexException if the index is corrupt
-   * @throws IOException if there is a low-level IO error
-   */
-  public static IndexReader open(final Directory directory, IndexDeletionPolicy deletionPolicy, boolean readOnly) throws CorruptIndexException, IOException {
-    return open(directory, deletionPolicy, null, readOnly, DEFAULT_TERMS_INDEX_DIVISOR);
-  }
-
-  /** Expert: returns an IndexReader reading the index in
-   *  the given Directory, with a custom {@link
-   *  IndexDeletionPolicy}.  You should pass readOnly=true,
-   *  since it gives much better concurrent performance,
-   *  unless you intend to do write operations (delete
-   *  documents or change norms) with the reader.
-   * @param directory the index directory
-   * @param deletionPolicy a custom deletion policy (only used
-   *  if you use this reader to perform deletes or to set
-   *  norms); see {@link IndexWriter} for details.
-   * @param readOnly true if no changes (deletions, norms) will be made with this IndexReader
-   * @param termInfosIndexDivisor Subsamples which indexed
-   *  terms are loaded into RAM. This has the same effect as {@link
-   *  IndexWriterConfig#setTermIndexInterval} except that setting
-   *  must be done at indexing time while this setting can be
-   *  set per reader.  When set to N, then one in every
-   *  N*termIndexInterval terms in the index is loaded into
-   *  memory.  By setting this to a value > 1 you can reduce
-   *  memory usage, at the expense of higher latency when
-   *  loading a TermInfo.  The default value is 1.  Set this
-   *  to -1 to skip loading the terms index entirely.
-   * @throws CorruptIndexException if the index is corrupt
-   * @throws IOException if there is a low-level IO error
-   */
-  public static IndexReader open(final Directory directory, IndexDeletionPolicy deletionPolicy, boolean readOnly, int termInfosIndexDivisor) throws CorruptIndexException, IOException {
-    return open(directory, deletionPolicy, null, readOnly, termInfosIndexDivisor);
-  }
-
-  /** Expert: returns an IndexReader reading the index in
-   *  the given Directory, using a specific commit and with
-   *  a custom {@link IndexDeletionPolicy}.  You should pass
-   *  readOnly=true, since it gives much better concurrent
-   *  performance, unless you intend to do write operations
-   *  (delete documents or change norms) with the reader.
-   * @param commit the specific {@link IndexCommit} to open;
-   * see {@link IndexReader#listCommits} to list all commits
-   * in a directory
-   * @param deletionPolicy a custom deletion policy (only used
-   *  if you use this reader to perform deletes or to set
-   *  norms); see {@link IndexWriter} for details.
-   * @param readOnly true if no changes (deletions, norms) will be made with this IndexReader
-   * @throws CorruptIndexException if the index is corrupt
-   * @throws IOException if there is a low-level IO error
-   */
-  public static IndexReader open(final IndexCommit commit, IndexDeletionPolicy deletionPolicy, boolean readOnly) throws CorruptIndexException, IOException {
-    return open(commit.getDirectory(), deletionPolicy, commit, readOnly, DEFAULT_TERMS_INDEX_DIVISOR);
-  }
-
-  /** Expert: returns an IndexReader reading the index in
-   *  the given Directory, using a specific commit and with
-   *  a custom {@link IndexDeletionPolicy}.  You should pass
-   *  readOnly=true, since it gives much better concurrent
-   *  performance, unless you intend to do write operations
-   *  (delete documents or change norms) with the reader.
-   * @param commit the specific {@link IndexCommit} to open;
-   * see {@link IndexReader#listCommits} to list all commits
-   * in a directory
-   * @param deletionPolicy a custom deletion policy (only used
-   *  if you use this reader to perform deletes or to set
-   *  norms); see {@link IndexWriter} for details.
-   * @param readOnly true if no changes (deletions, norms) will be made with this IndexReader
-   * @param termInfosIndexDivisor Subsamples which indexed
-   *  terms are loaded into RAM. This has the same effect as {@link
-   *  IndexWriterConfig#setTermIndexInterval} except that setting
-   *  must be done at indexing time while this setting can be
-   *  set per reader.  When set to N, then one in every
-   *  N*termIndexInterval terms in the index is loaded into
-   *  memory.  By setting this to a value > 1 you can reduce
-   *  memory usage, at the expense of higher latency when
-   *  loading a TermInfo.  The default value is 1.  Set this
-   *  to -1 to skip loading the terms index entirely. This is only useful in 
-   *  advanced situations when you will only .next() through all terms; 
-   *  attempts to seek will hit an exception.
-   *  
-   * @throws CorruptIndexException if the index is corrupt
-   * @throws IOException if there is a low-level IO error
-   */
-  public static IndexReader open(final IndexCommit commit, IndexDeletionPolicy deletionPolicy, boolean readOnly, int termInfosIndexDivisor) throws CorruptIndexException, IOException {
-    return open(commit.getDirectory(), deletionPolicy, commit, readOnly, termInfosIndexDivisor);
-  }
 
-  private static IndexReader open(final Directory directory, final IndexDeletionPolicy deletionPolicy, final IndexCommit commit, final boolean readOnly, int termInfosIndexDivisor) throws CorruptIndexException, IOException {
-    // nocommit: deletionPolicy is ignored -> remove it, same for readonly
+  private static IndexReader open(final Directory directory, final IndexCommit commit, int termInfosIndexDivisor) throws CorruptIndexException, IOException {
     return DirectoryReader.open(directory, commit, termInfosIndexDivisor);
   }
 

Modified: lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java Mon Dec  5 01:41:38 2011
@@ -62,7 +62,7 @@ public class PersistentSnapshotDeletionP
    * keeps a lock on the snapshots directory).
    */
   public static Map<String, String> readSnapshotsInfo(Directory dir) throws IOException {
-    IndexReader r = IndexReader.open(dir, true);
+    IndexReader r = IndexReader.open(dir);
     Map<String, String> snapshots = new HashMap<String, String>();
     try {
       int numDocs = r.numDocs();

Modified: lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/search/SearcherManager.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/search/SearcherManager.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/search/SearcherManager.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/java/org/apache/lucene/search/SearcherManager.java Mon Dec  5 01:41:38 2011
@@ -128,7 +128,7 @@ public final class SearcherManager {
       ExecutorService es) throws IOException {
     this.es = es;
     this.warmer = warmer;
-    currentSearcher = new IndexSearcher(IndexReader.open(dir, true), es);
+    currentSearcher = new IndexSearcher(IndexReader.open(dir), es);
   }
 
   /**

Modified: lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/analysis/CollationTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/analysis/CollationTestBase.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/analysis/CollationTestBase.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/analysis/CollationTestBase.java Mon Dec  5 01:41:38 2011
@@ -147,7 +147,7 @@ public abstract class CollationTestBase 
     writer.addDocument(doc);
     writer.close();
 
-    IndexReader reader = IndexReader.open(farsiIndex, true);
+    IndexReader reader = IndexReader.open(farsiIndex);
     IndexSearcher search = newSearcher(reader);
         
     // Unicode order would include U+0633 in [ U+062F - U+0698 ], but Farsi

Modified: lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/index/RandomIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/index/RandomIndexWriter.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/index/RandomIndexWriter.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/index/RandomIndexWriter.java Mon Dec  5 01:41:38 2011
@@ -385,7 +385,7 @@ public class RandomIndexWriter implement
       w.commit();
       switchDoDocValues();
       if (r.nextBoolean()) {
-        return IndexReader.open(w.getDirectory(), new KeepOnlyLastCommitDeletionPolicy(), r.nextBoolean(), _TestUtil.nextInt(r, 1, 10));
+        return IndexReader.open(w.getDirectory(), _TestUtil.nextInt(r, 1, 10));
       } else {
         return w.getReader(applyDeletions);
       }

Modified: lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/search/QueryUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/search/QueryUtils.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/search/QueryUtils.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test-framework/java/org/apache/lucene/search/QueryUtils.java Mon Dec  5 01:41:38 2011
@@ -200,7 +200,7 @@ public class QueryUtils {
       Assert.assertEquals("writer has non-deleted docs", 
                           0, w.numDocs());
       w.close();
-      IndexReader r = IndexReader.open(d, true);
+      IndexReader r = IndexReader.open(d);
       Assert.assertEquals("reader has wrong number of deleted docs", 
                           numDeletedDocs, r.numDeletedDocs());
       return r;

Modified: lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestAddIndexes.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestAddIndexes.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestAddIndexes.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestAddIndexes.java Mon Dec  5 01:41:38 2011
@@ -424,7 +424,7 @@ public class TestAddIndexes extends Luce
 
     setUpDirs(dir, aux);
 
-    IndexReader reader = IndexReader.open(aux, false);
+    IndexReader reader = IndexReader.open(aux);
     for (int i = 0; i < 20; i++) {
       reader.deleteDocument(i);
     }
@@ -469,14 +469,14 @@ public class TestAddIndexes extends Luce
     assertEquals(3, writer.getSegmentCount());
     writer.close();
 
-    IndexReader reader = IndexReader.open(aux, false);
+    IndexReader reader = IndexReader.open(aux);
     for (int i = 0; i < 27; i++) {
       reader.deleteDocument(i);
     }
     assertEquals(3, reader.numDocs());
     reader.close();
 
-    reader = IndexReader.open(aux2, false);
+    reader = IndexReader.open(aux2);
     for (int i = 0; i < 8; i++) {
       reader.deleteDocument(i);
     }
@@ -525,7 +525,7 @@ public class TestAddIndexes extends Luce
   }
 
   private void verifyNumDocs(Directory dir, int numDocs) throws IOException {
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     assertEquals(numDocs, reader.maxDoc());
     assertEquals(numDocs, reader.numDocs());
     reader.close();
@@ -533,7 +533,7 @@ public class TestAddIndexes extends Luce
 
   private void verifyTermDocs(Directory dir, Term term, int numDocs)
       throws IOException {
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     DocsEnum docsEnum = _TestUtil.docs(random, reader, term.field, term.bytes, null, null, false);
     int count = 0;
     while (docsEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS)
@@ -659,7 +659,7 @@ public class TestAddIndexes extends Luce
 
       readers = new IndexReader[NUM_COPY];
       for(int i=0;i<NUM_COPY;i++)
-        readers[i] = IndexReader.open(dir, true);
+        readers[i] = IndexReader.open(dir);
     }
 
     void launchThreads(final int numIter) {
@@ -785,7 +785,7 @@ public class TestAddIndexes extends Luce
 
     assertTrue("found unexpected failures: " + c.failures, c.failures.isEmpty());
 
-    IndexReader reader = IndexReader.open(c.dir2, true);
+    IndexReader reader = IndexReader.open(c.dir2);
     assertEquals(expectedNumDocs, reader.numDocs());
     reader.close();
 

Modified: lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestAtomicUpdate.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestAtomicUpdate.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestAtomicUpdate.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestAtomicUpdate.java Mon Dec  5 01:41:38 2011
@@ -112,7 +112,7 @@ public class TestAtomicUpdate extends Lu
 
     @Override
     public void doWork() throws Throwable {
-      IndexReader r = IndexReader.open(directory, true);
+      IndexReader r = IndexReader.open(directory);
       assertEquals(100, r.numDocs());
       r.close();
     }
@@ -144,7 +144,7 @@ public class TestAtomicUpdate extends Lu
     }
     writer.commit();
 
-    IndexReader r = IndexReader.open(directory, true);
+    IndexReader r = IndexReader.open(directory);
     assertEquals(100, r.numDocs());
     r.close();
 

Modified: lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java Mon Dec  5 01:41:38 2011
@@ -113,7 +113,7 @@ public class TestConcurrentMergeSchedule
     }
 
     writer.close();
-    IndexReader reader = IndexReader.open(directory, true);
+    IndexReader reader = IndexReader.open(directory);
     assertEquals(200+extraCount, reader.numDocs());
     reader.close();
     directory.close();
@@ -158,7 +158,7 @@ public class TestConcurrentMergeSchedule
     }
 
     writer.close();
-    IndexReader reader = IndexReader.open(directory, true);
+    IndexReader reader = IndexReader.open(directory);
     // Verify that we did not lose any deletes...
     assertEquals(450, reader.numDocs());
     reader.close();
@@ -230,7 +230,7 @@ public class TestConcurrentMergeSchedule
 
       writer.close(false);
 
-      IndexReader reader = IndexReader.open(directory, true);
+      IndexReader reader = IndexReader.open(directory);
       assertEquals((1+iter)*182, reader.numDocs());
       reader.close();
 

Modified: lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestCrash.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestCrash.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestCrash.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestCrash.java Mon Dec  5 01:41:38 2011
@@ -68,7 +68,7 @@ public class TestCrash extends LuceneTes
     IndexWriter writer = initIndex(random, true);
     MockDirectoryWrapper dir = (MockDirectoryWrapper) writer.getDirectory();
     crash(writer);
-    IndexReader reader = IndexReader.open(dir, false);
+    IndexReader reader = IndexReader.open(dir);
     assertTrue(reader.numDocs() < 157);
     reader.close();
     dir.close();
@@ -85,7 +85,7 @@ public class TestCrash extends LuceneTes
     writer = initIndex(random, dir, false);
     writer.close();
 
-    IndexReader reader = IndexReader.open(dir, false);
+    IndexReader reader = IndexReader.open(dir);
     assertTrue(reader.numDocs() < 314);
     reader.close();
     dir.close();
@@ -108,7 +108,7 @@ public class TestCrash extends LuceneTes
     dir.fileLength(l[i]) + " bytes");
     */
 
-    IndexReader reader = IndexReader.open(dir, false);
+    IndexReader reader = IndexReader.open(dir);
     assertTrue(reader.numDocs() >= 157);
     reader.close();
     dir.close();
@@ -129,7 +129,7 @@ public class TestCrash extends LuceneTes
       System.out.println("file " + i + " = " + l[i] + " " + dir.fileLength(l[i]) + " bytes");
     */
 
-    IndexReader reader = IndexReader.open(dir, false);
+    IndexReader reader = IndexReader.open(dir);
     assertEquals(157, reader.numDocs());
     reader.close();
     dir.close();
@@ -150,7 +150,7 @@ public class TestCrash extends LuceneTes
     for(int i=0;i<l.length;i++)
       System.out.println("file " + i + " = " + l[i] + " " + dir.fileLength(l[i]) + " bytes");
     */
-    IndexReader reader = IndexReader.open(dir, false);
+    IndexReader reader = IndexReader.open(dir);
     assertEquals(157, reader.numDocs());
     reader.close();
     dir.close();

Modified: lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDeletionPolicy.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDeletionPolicy.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDeletionPolicy.java Mon Dec  5 01:41:38 2011
@@ -73,7 +73,7 @@ public class TestDeletionPolicy extends 
     }
     public void onCommit(List<? extends IndexCommit> commits) throws IOException {
       IndexCommit lastCommit =  commits.get(commits.size()-1);
-      IndexReader r = IndexReader.open(dir, true);
+      IndexReader r = IndexReader.open(dir);
       assertEquals("lastCommit.segmentCount()=" + lastCommit.getSegmentCount() + " vs IndexReader.segmentCount=" + r.getSequentialSubReaders().length, r.getSequentialSubReaders().length, lastCommit.getSegmentCount());
       r.close();
       verifyCommitOrder(commits);
@@ -259,7 +259,7 @@ public class TestDeletionPolicy extends 
 
     while(gen > 0) {
       try {
-        IndexReader reader = IndexReader.open(dir, true);
+        IndexReader reader = IndexReader.open(dir);
         reader.close();
         fileName = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,
                                                          "",
@@ -351,7 +351,7 @@ public class TestDeletionPolicy extends 
 
       // Make sure we can open a reader on each commit:
       for (final IndexCommit commit : commits) {
-        IndexReader r = IndexReader.open(commit, null, false);
+        IndexReader r = IndexReader.open(commit);
         r.close();
       }
 
@@ -360,7 +360,7 @@ public class TestDeletionPolicy extends 
       dir.deleteFile(IndexFileNames.SEGMENTS_GEN);
       long gen = SegmentInfos.getCurrentSegmentGeneration(dir);
       while(gen > 0) {
-        IndexReader reader = IndexReader.open(dir, true);
+        IndexReader reader = IndexReader.open(dir);
         reader.close();
         dir.deleteFile(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen));
         gen--;
@@ -435,7 +435,7 @@ public class TestDeletionPolicy extends 
     // Should undo our rollback:
     writer.rollback();
 
-    IndexReader r = IndexReader.open(dir, true);
+    IndexReader r = IndexReader.open(dir);
     // Still merged, still 11 docs
     assertEquals(1, r.getSequentialSubReaders().length);
     assertEquals(11, r.numDocs());
@@ -450,7 +450,7 @@ public class TestDeletionPolicy extends 
     // Now 8 because we made another commit
     assertEquals(7, IndexReader.listCommits(dir).size());
     
-    r = IndexReader.open(dir, true);
+    r = IndexReader.open(dir);
     // Not fully merged because we rolled it back, and now only
     // 10 docs
     assertTrue(r.getSequentialSubReaders().length > 1);
@@ -462,7 +462,7 @@ public class TestDeletionPolicy extends 
     writer.forceMerge(1);
     writer.close();
 
-    r = IndexReader.open(dir, true);
+    r = IndexReader.open(dir);
     assertEquals(1, r.getSequentialSubReaders().length);
     assertEquals(10, r.numDocs());
     r.close();
@@ -474,7 +474,7 @@ public class TestDeletionPolicy extends 
     
     // Reader still sees fully merged index, because writer
     // opened on the prior commit has not yet committed:
-    r = IndexReader.open(dir, true);
+    r = IndexReader.open(dir);
     assertEquals(1, r.getSequentialSubReaders().length);
     assertEquals(10, r.numDocs());
     r.close();
@@ -482,7 +482,7 @@ public class TestDeletionPolicy extends 
     writer.close();
 
     // Now reader sees not-fully-merged index:
-    r = IndexReader.open(dir, true);
+    r = IndexReader.open(dir);
     assertTrue(r.getSequentialSubReaders().length > 1);
     assertEquals(10, r.numDocs());
     r.close();
@@ -535,7 +535,7 @@ public class TestDeletionPolicy extends 
 
       // Simplistic check: just verify the index is in fact
       // readable:
-      IndexReader reader = IndexReader.open(dir, true);
+      IndexReader reader = IndexReader.open(dir);
       reader.close();
 
       dir.close();
@@ -583,7 +583,7 @@ public class TestDeletionPolicy extends 
       long gen = SegmentInfos.getCurrentSegmentGeneration(dir);
       for(int i=0;i<N+1;i++) {
         try {
-          IndexReader reader = IndexReader.open(dir, true);
+          IndexReader reader = IndexReader.open(dir);
           reader.close();
           if (i == N) {
             fail("should have failed on commits prior to last " + N);
@@ -668,7 +668,7 @@ public class TestDeletionPolicy extends 
       assertEquals(3*(N+1), policy.numOnInit);
       assertEquals(3*(N+1)+1, policy.numOnCommit);
 
-      IndexReader rwReader = IndexReader.open(dir, false);
+      IndexReader rwReader = IndexReader.open(dir);
       IndexSearcher searcher = new IndexSearcher(rwReader);
       ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
       assertEquals(0, hits.length);
@@ -685,7 +685,7 @@ public class TestDeletionPolicy extends 
 
       for(int i=0;i<N+1;i++) {
         try {
-          IndexReader reader = IndexReader.open(dir, true);
+          IndexReader reader = IndexReader.open(dir);
 
           // Work backwards in commits on what the expected
           // count should be.

Modified: lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDirectoryReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDirectoryReader.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDirectoryReader.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDirectoryReader.java Mon Dec  5 01:41:38 2011
@@ -64,7 +64,7 @@ public class TestDirectoryReader extends
 
   protected IndexReader openReader() throws IOException {
     IndexReader reader;
-    reader = IndexReader.open(dir, false);
+    reader = IndexReader.open(dir);
     assertTrue(reader instanceof DirectoryReader);
 
     assertTrue(dir != null);
@@ -95,7 +95,7 @@ public class TestDirectoryReader extends
     addDoc(random, ramDir1, "test foo", true);
     Directory ramDir2=newDirectory();
     addDoc(random, ramDir2, "test blah", true);
-    IndexReader[] readers = new IndexReader[]{IndexReader.open(ramDir1, false), IndexReader.open(ramDir2, false)};
+    IndexReader[] readers = new IndexReader[]{IndexReader.open(ramDir1), IndexReader.open(ramDir2)};
     MultiReader mr = new MultiReader(readers);
     assertTrue(mr.isCurrent());   // just opened, must be current
     addDoc(random, ramDir1, "more text", false);
@@ -121,8 +121,8 @@ public class TestDirectoryReader extends
     Directory ramDir3=newDirectory();
     addDoc(random, ramDir3, "test wow", true);
 
-    IndexReader[] readers1 = new IndexReader[]{IndexReader.open(ramDir1, false), IndexReader.open(ramDir3, false)};
-    IndexReader[] readers2 = new IndexReader[]{IndexReader.open(ramDir1, false), IndexReader.open(ramDir2, false), IndexReader.open(ramDir3, false)};
+    IndexReader[] readers1 = new IndexReader[]{IndexReader.open(ramDir1), IndexReader.open(ramDir3)};
+    IndexReader[] readers2 = new IndexReader[]{IndexReader.open(ramDir1), IndexReader.open(ramDir2), IndexReader.open(ramDir3)};
     MultiReader mr2 = new MultiReader(readers1);
     MultiReader mr3 = new MultiReader(readers2);
 

Modified: lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDocumentWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDocumentWriter.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDocumentWriter.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestDocumentWriter.java Mon Dec  5 01:41:38 2011
@@ -285,7 +285,7 @@ public class TestDocumentWriter extends 
 
     _TestUtil.checkIndex(dir);
 
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     // f1
     Terms tfv1 = reader.getTermVectors(0).terms("f1");
     assertNotNull(tfv1);
@@ -326,7 +326,7 @@ public class TestDocumentWriter extends 
 
     _TestUtil.checkIndex(dir);
 
-    SegmentReader reader = getOnlySegmentReader(IndexReader.open(dir, false));
+    SegmentReader reader = getOnlySegmentReader(IndexReader.open(dir));
     FieldInfos fi = reader.fieldInfos();
     // f1
     assertFalse("f1 should have no norms", reader.hasNorms("f1"));

Modified: lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestFieldsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestFieldsReader.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestFieldsReader.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestFieldsReader.java Mon Dec  5 01:41:38 2011
@@ -206,7 +206,7 @@ public class TestFieldsReader extends Lu
       writer.forceMerge(1);
       writer.close();
 
-      IndexReader reader = IndexReader.open(dir, true);
+      IndexReader reader = IndexReader.open(dir);
 
       FaultyIndexInput.doFail = true;
 

Modified: lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestFilterIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestFilterIndexReader.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestFilterIndexReader.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestFilterIndexReader.java Mon Dec  5 01:41:38 2011
@@ -144,11 +144,11 @@ public class TestFilterIndexReader exten
 
     Directory target = newDirectory();
     writer = new IndexWriter(target, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)));
-    IndexReader reader = new TestReader(IndexReader.open(directory, true));
+    IndexReader reader = new TestReader(IndexReader.open(directory));
     writer.addIndexes(reader);
     writer.close();
     reader.close();
-    reader = IndexReader.open(target, true);
+    reader = IndexReader.open(target);
     
     TermsEnum terms = MultiFields.getTerms(reader, "default").iterator(null);
     while (terms.next() != null) {

Modified: lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexReader.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexReader.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexReader.java Mon Dec  5 01:41:38 2011
@@ -61,7 +61,7 @@ public class TestIndexReader extends Luc
       addDocumentWithFields(writer);
       writer.close();
       // set up reader:
-      IndexReader reader = IndexReader.open(d, false);
+      IndexReader reader = IndexReader.open(d);
       assertTrue(reader.isCurrent());
       // modify index by adding another document:
       writer = new IndexWriter(d, newIndexWriterConfig(TEST_VERSION_CURRENT,
@@ -104,7 +104,7 @@ public class TestIndexReader extends Luc
 
         writer.close();
         // set up reader
-        IndexReader reader = IndexReader.open(d, false);
+        IndexReader reader = IndexReader.open(d);
         Collection<String> fieldNames = reader.getFieldNames(IndexReader.FieldOption.ALL);
         assertTrue(fieldNames.contains("keyword"));
         assertTrue(fieldNames.contains("text"));
@@ -164,7 +164,7 @@ public class TestIndexReader extends Luc
         
         writer.close();
         // verify fields again
-        reader = IndexReader.open(d, false);
+        reader = IndexReader.open(d);
         fieldNames = reader.getFieldNames(IndexReader.FieldOption.ALL);
         assertEquals(13, fieldNames.size());    // the following fields
         assertTrue(fieldNames.contains("keyword"));
@@ -299,7 +299,7 @@ public class TestIndexReader extends Luc
         doc.add(new TextField("junk", "junk text"));
         writer.addDocument(doc);
         writer.close();
-        IndexReader reader = IndexReader.open(dir, false);
+        IndexReader reader = IndexReader.open(dir);
         Document doc2 = reader.document(reader.maxDoc() - 1);
         IndexableField[] fields = doc2.getFields("bin1");
         assertNotNull(fields);
@@ -318,7 +318,7 @@ public class TestIndexReader extends Luc
         writer = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)).setOpenMode(OpenMode.APPEND).setMergePolicy(newLogMergePolicy()));
         writer.forceMerge(1);
         writer.close();
-        reader = IndexReader.open(dir, false);
+        reader = IndexReader.open(dir);
         doc2 = reader.document(reader.maxDoc() - 1);
         fields = doc2.getFields("bin1");
         assertNotNull(fields);
@@ -370,7 +370,7 @@ public class TestIndexReader extends Luc
 
         // Now open existing directory and test that reader closes all files
         dir = newFSDirectory(dirFile);
-        IndexReader reader1 = IndexReader.open(dir, false);
+        IndexReader reader1 = IndexReader.open(dir);
         reader1.close();
         dir.close();
 
@@ -388,7 +388,7 @@ public class TestIndexReader extends Luc
         assertTrue(IndexWriter.isLocked(dir));		// writer open, so dir is locked
         writer.close();
         assertTrue(IndexReader.indexExists(dir));
-        IndexReader reader = IndexReader.open(dir, false);
+        IndexReader reader = IndexReader.open(dir);
         assertFalse(IndexWriter.isLocked(dir));		// reader only, no lock
         long version = IndexReader.lastModified(dir);
         if (i == 1) {
@@ -403,7 +403,7 @@ public class TestIndexReader extends Luc
         writer  = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)).setOpenMode(OpenMode.CREATE));
         addDocumentWithFields(writer);
         writer.close();
-        reader = IndexReader.open(dir, false);
+        reader = IndexReader.open(dir);
         assertTrue("old lastModified is " + version + "; new lastModified is " + IndexReader.lastModified(dir), version <= IndexReader.lastModified(dir));
         reader.close();
         dir.close();
@@ -418,7 +418,7 @@ public class TestIndexReader extends Luc
       assertTrue(IndexWriter.isLocked(dir));		// writer open, so dir is locked
       writer.close();
       assertTrue(IndexReader.indexExists(dir));
-      IndexReader reader = IndexReader.open(dir, false);
+      IndexReader reader = IndexReader.open(dir);
       assertFalse(IndexWriter.isLocked(dir));		// reader only, no lock
       long version = IndexReader.getCurrentVersion(dir);
       reader.close();
@@ -427,7 +427,7 @@ public class TestIndexReader extends Luc
       writer  = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)).setOpenMode(OpenMode.CREATE));
       addDocumentWithFields(writer);
       writer.close();
-      reader = IndexReader.open(dir, false);
+      reader = IndexReader.open(dir);
       assertTrue("old version is " + version + "; new version is " + IndexReader.getCurrentVersion(dir), version < IndexReader.getCurrentVersion(dir));
       reader.close();
       dir.close();
@@ -437,7 +437,7 @@ public class TestIndexReader extends Luc
       File dirFile = _TestUtil.getTempDir("deletetest");
       Directory dir = newFSDirectory(dirFile);
       try {
-        IndexReader.open(dir, false);
+        IndexReader.open(dir);
         fail("expected FileNotFoundException");
       } catch (FileNotFoundException e) {
         // expected
@@ -447,7 +447,7 @@ public class TestIndexReader extends Luc
 
       // Make sure we still get a CorruptIndexException (not NPE):
       try {
-        IndexReader.open(dir, false);
+        IndexReader.open(dir);
         fail("expected FileNotFoundException");
       } catch (FileNotFoundException e) {
         // expected
@@ -629,7 +629,7 @@ public class TestIndexReader extends Luc
 
       SegmentInfos sis = new SegmentInfos();
       sis.read(d);
-      IndexReader r = IndexReader.open(d, false);
+      IndexReader r = IndexReader.open(d);
       IndexCommit c = r.getIndexCommit();
 
       assertEquals(sis.getCurrentSegmentFileName(), c.getSegmentsFileName());
@@ -686,7 +686,7 @@ public class TestIndexReader extends Luc
   public void testNoDir() throws Throwable {
     Directory dir = newFSDirectory(_TestUtil.getTempDir("doesnotexist"));
     try {
-      IndexReader.open(dir, true);
+      IndexReader.open(dir);
       fail("did not hit expected exception");
     } catch (NoSuchDirectoryException nsde) {
       // expected
@@ -731,7 +731,7 @@ public class TestIndexReader extends Luc
     writer.close();
 
     // Open reader
-    IndexReader r = getOnlySegmentReader(IndexReader.open(dir, false));
+    IndexReader r = getOnlySegmentReader(IndexReader.open(dir));
     final int[] ints = FieldCache.DEFAULT.getInts(r, "number", false);
     assertEquals(1, ints.length);
     assertEquals(17, ints[0]);
@@ -766,7 +766,7 @@ public class TestIndexReader extends Luc
     writer.commit();
 
     // Open reader1
-    IndexReader r = IndexReader.open(dir, false);
+    IndexReader r = IndexReader.open(dir);
     IndexReader r1 = getOnlySegmentReader(r);
     final int[] ints = FieldCache.DEFAULT.getInts(r1, "number", false);
     assertEquals(1, ints.length);
@@ -800,7 +800,7 @@ public class TestIndexReader extends Luc
     writer.addDocument(doc);
     writer.commit();
 
-    IndexReader r = IndexReader.open(dir, false);
+    IndexReader r = IndexReader.open(dir);
     IndexReader r1 = getOnlySegmentReader(r);
     assertEquals(36, r1.getUniqueTermCount());
     writer.addDocument(doc);
@@ -830,7 +830,7 @@ public class TestIndexReader extends Luc
     writer.addDocument(doc);
     writer.close();
 
-    IndexReader r = IndexReader.open(dir, null, true, -1);
+    IndexReader r = IndexReader.open(dir, -1);
     try {
       r.docFreq(new Term("field", "f"));
       fail("did not hit expected exception");
@@ -875,7 +875,7 @@ public class TestIndexReader extends Luc
     writer.commit();
     Document doc = new Document();
     writer.addDocument(doc);
-    IndexReader r = IndexReader.open(dir, true);
+    IndexReader r = IndexReader.open(dir);
     assertTrue(r.isCurrent());
     writer.addDocument(doc);
     writer.prepareCommit();

Modified: lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java Mon Dec  5 01:41:38 2011
@@ -182,7 +182,7 @@ public class TestIndexWriter extends Luc
       writer.close();
 
       // now open reader:
-      IndexReader reader = IndexReader.open(dir, true);
+      IndexReader reader = IndexReader.open(dir);
       assertEquals("should be one document", reader.numDocs(), 1);
 
       // now open index for create:
@@ -192,7 +192,7 @@ public class TestIndexWriter extends Luc
       writer.close();
 
       assertEquals("should be one document", reader.numDocs(), 1);
-      IndexReader reader2 = IndexReader.open(dir, true);
+      IndexReader reader2 = IndexReader.open(dir);
       assertEquals("should be one document", reader2.numDocs(), 1);
       reader.close();
       reader2.close();
@@ -227,7 +227,7 @@ public class TestIndexWriter extends Luc
       writer.commit();
       writer.close();
 
-      IndexReader reader = IndexReader.open(dir, true);
+      IndexReader reader = IndexReader.open(dir);
       assertEquals(0, reader.maxDoc());
       assertEquals(0, reader.numDocs());
       reader.close();
@@ -236,7 +236,7 @@ public class TestIndexWriter extends Luc
       writer.commit();
       writer.close();
 
-      reader = IndexReader.open(dir, true);
+      reader = IndexReader.open(dir);
       assertEquals(0, reader.maxDoc());
       assertEquals(0, reader.numDocs());
       reader.close();
@@ -258,7 +258,7 @@ public class TestIndexWriter extends Luc
       }
       writer.close();
 
-      IndexReader reader = IndexReader.open(dir, true);
+      IndexReader reader = IndexReader.open(dir);
       assertEquals(100, reader.maxDoc());
       assertEquals(100, reader.numDocs());
       for(int j=0;j<100;j++) {
@@ -452,7 +452,7 @@ public class TestIndexWriter extends Luc
       }
       writer.close();
 
-      IndexReader reader = IndexReader.open(dir, false);
+      IndexReader reader = IndexReader.open(dir);
       IndexSearcher searcher = new IndexSearcher(reader);
       ScoreDoc[] hits = searcher.search(new TermQuery(new Term("field", "aaa")), null, 1000).scoreDocs;
       assertEquals(300, hits.length);
@@ -484,7 +484,7 @@ public class TestIndexWriter extends Luc
 
       Term searchTerm = new Term("field", "aaa");
 
-      IndexReader reader = IndexReader.open(dir, false);
+      IndexReader reader = IndexReader.open(dir);
       IndexSearcher searcher = new IndexSearcher(reader);
       ScoreDoc[] hits = searcher.search(new TermQuery(searchTerm), null, 1000).scoreDocs;
       assertEquals(10, hits.length);
@@ -507,14 +507,14 @@ public class TestIndexWriter extends Luc
         writer.addDocument(doc);
       }
       writer.close();
-      reader = IndexReader.open(dir, false);
+      reader = IndexReader.open(dir);
       searcher = new IndexSearcher(reader);
       hits = searcher.search(new TermQuery(searchTerm), null, 1000).scoreDocs;
       assertEquals(27, hits.length);
       searcher.close();
       reader.close();
 
-      reader = IndexReader.open(dir, true);
+      reader = IndexReader.open(dir);
       reader.close();
 
       dir.close();
@@ -541,7 +541,7 @@ public class TestIndexWriter extends Luc
       writer.addDocument(doc);
       writer.close();
 
-      IndexReader reader = IndexReader.open(dir, true);
+      IndexReader reader = IndexReader.open(dir);
       assertEquals(1, reader.maxDoc());
       assertEquals(1, reader.numDocs());
       Term t = new Term("field", "a");
@@ -586,7 +586,7 @@ public class TestIndexWriter extends Luc
       }
       writer.close();
       Term searchTerm = new Term("content", "aaa");
-      IndexReader reader = IndexReader.open(dir, false);
+      IndexReader reader = IndexReader.open(dir);
       IndexSearcher searcher = new IndexSearcher(reader);
       ScoreDoc[] hits = searcher.search(new TermQuery(searchTerm), null, 1000).scoreDocs;
       assertEquals("did not get right number of hits", 100, hits.length);
@@ -643,7 +643,7 @@ public class TestIndexWriter extends Luc
       }
       writer.addDocument(new Document());
       writer.close();
-      IndexReader reader = IndexReader.open(dir, true);
+      IndexReader reader = IndexReader.open(dir);
       assertEquals(2, reader.numDocs());
       reader.close();
       dir.close();
@@ -826,7 +826,7 @@ public class TestIndexWriter extends Luc
         t1.join();
 
         // Make sure reader can read
-        IndexReader reader = IndexReader.open(directory, true);
+        IndexReader reader = IndexReader.open(directory);
         reader.close();
 
         // Reopen
@@ -854,7 +854,7 @@ public class TestIndexWriter extends Luc
     writer.addDocument(doc);
     writer.close();
 
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     Term t = new Term("field", "x");
     assertEquals(1, reader.docFreq(t));
     reader.close();
@@ -881,7 +881,7 @@ public class TestIndexWriter extends Luc
     doc.add(newField("", "a b c", TextField.TYPE_UNSTORED));
     writer.addDocument(doc);  
     writer.close();
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     IndexReader subreader = getOnlySegmentReader(reader);
     TermsEnum te = subreader.fields().terms("").iterator(null);
     assertEquals(new BytesRef("a"), te.next());
@@ -902,7 +902,7 @@ public class TestIndexWriter extends Luc
     doc.add(newField("", "c", StringField.TYPE_UNSTORED));
     writer.addDocument(doc);  
     writer.close();
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     IndexReader subreader = getOnlySegmentReader(reader);
     TermsEnum te = subreader.fields().terms("").iterator(null);
     assertEquals(new BytesRef(""), te.next());
@@ -956,7 +956,7 @@ public class TestIndexWriter extends Luc
     assertTrue(w.afterWasCalled);
     w.close();
 
-    IndexReader ir = IndexReader.open(dir, true);
+    IndexReader ir = IndexReader.open(dir);
     assertEquals(0, ir.numDocs());
     ir.close();
 
@@ -990,7 +990,7 @@ public class TestIndexWriter extends Luc
     w.addDocument(doc);
     w.commit();
 
-    IndexReader r = IndexReader.open(dir, false);
+    IndexReader r = IndexReader.open(dir);
     IndexSearcher s = new IndexSearcher(r);
     PhraseQuery pq = new PhraseQuery();
     pq.add(new Term("field", "a"));
@@ -1039,7 +1039,7 @@ public class TestIndexWriter extends Luc
     w.addDocument(doc);
     w.close();
 
-    IndexReader ir = IndexReader.open(dir, true);
+    IndexReader ir = IndexReader.open(dir);
     Document doc2 = ir.document(0);
     IndexableField f2 = doc2.getField("binary");
     b = f2.binaryValue().bytes;
@@ -1068,7 +1068,7 @@ public class TestIndexWriter extends Luc
     w.addDocument(doc);
     w.close();
 
-    IndexReader r = IndexReader.open(dir, true);
+    IndexReader r = IndexReader.open(dir);
     Terms tpv = r.getTermVectors(0).terms("field");
     TermsEnum termsEnum = tpv.iterator(null);
     assertNotNull(termsEnum.next());
@@ -1132,12 +1132,12 @@ public class TestIndexWriter extends Luc
     writer2.addDocument(doc);
     writer2.close();
 
-    IndexReader r1 = IndexReader.open(dir2, true);
+    IndexReader r1 = IndexReader.open(dir2);
     IndexReader r2 = (IndexReader) r1.clone();
     writer.addIndexes(r1, r2);
     writer.close();
 
-    IndexReader r3 = IndexReader.open(dir, true);
+    IndexReader r3 = IndexReader.open(dir);
     assertEquals(5, r3.numDocs());
     r3.close();
 
@@ -1182,7 +1182,7 @@ public class TestIndexWriter extends Luc
             w.close();
             w = null;
             _TestUtil.checkIndex(dir);
-            IndexReader.open(dir, true).close();
+            IndexReader.open(dir).close();
 
             // Strangely, if we interrupt a thread before
             // all classes are loaded, the class loader
@@ -1232,7 +1232,7 @@ public class TestIndexWriter extends Luc
           e.printStackTrace(System.out);
         }
         try {
-          IndexReader r = IndexReader.open(dir, true);
+          IndexReader r = IndexReader.open(dir);
           //System.out.println("doc count=" + r.numDocs());
           r.close();
         } catch (Exception e) {
@@ -1318,7 +1318,7 @@ public class TestIndexWriter extends Luc
     w.forceMerge(1);   // force segment merge.
     w.close();
 
-    IndexReader ir = IndexReader.open(dir, true);
+    IndexReader ir = IndexReader.open(dir);
     Document doc2 = ir.document(0);
     IndexableField f3 = doc2.getField("binary");
     b = f3.binaryValue().bytes;

Modified: lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterCommit.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterCommit.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterCommit.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterCommit.java Mon Dec  5 01:41:38 2011
@@ -51,21 +51,21 @@ public class TestIndexWriterCommit exten
       writer.close();
 
       Term searchTerm = new Term("content", "aaa");
-      IndexReader reader = IndexReader.open(dir, false);
+      IndexReader reader = IndexReader.open(dir);
       IndexSearcher searcher = new IndexSearcher(reader);
       ScoreDoc[] hits = searcher.search(new TermQuery(searchTerm), null, 1000).scoreDocs;
       assertEquals("first number of hits", 14, hits.length);
       searcher.close();
       reader.close();
 
-      reader = IndexReader.open(dir, true);
+      reader = IndexReader.open(dir);
 
       writer = new IndexWriter(dir, newIndexWriterConfig( TEST_VERSION_CURRENT, new MockAnalyzer(random)));
       for(int i=0;i<3;i++) {
         for(int j=0;j<11;j++) {
           TestIndexWriter.addDoc(writer);
         }
-        IndexReader r = IndexReader.open(dir, false);
+        IndexReader r = IndexReader.open(dir);
         searcher = new IndexSearcher(r);
         hits = searcher.search(new TermQuery(searchTerm), null, 1000).scoreDocs;
         assertEquals("reader incorrectly sees changes from writer", 14, hits.length);
@@ -78,7 +78,7 @@ public class TestIndexWriterCommit exten
       writer.close();
       assertFalse("reader should not be current now", reader.isCurrent());
 
-      IndexReader r = IndexReader.open(dir, false);
+      IndexReader r = IndexReader.open(dir);
       searcher = new IndexSearcher(r);
       hits = searcher.search(new TermQuery(searchTerm), null, 1000).scoreDocs;
       assertEquals("reader did not see changes after writer was closed", 47, hits.length);
@@ -105,7 +105,7 @@ public class TestIndexWriterCommit exten
     writer.close();
 
     Term searchTerm = new Term("content", "aaa");
-    IndexReader reader = IndexReader.open(dir, false);
+    IndexReader reader = IndexReader.open(dir);
     IndexSearcher searcher = new IndexSearcher(reader);
     ScoreDoc[] hits = searcher.search(new TermQuery(searchTerm), null, 1000).scoreDocs;
     assertEquals("first number of hits", 14, hits.length);
@@ -120,7 +120,7 @@ public class TestIndexWriterCommit exten
     // Delete all docs:
     writer.deleteDocuments(searchTerm);
 
-    reader = IndexReader.open(dir, false);
+    reader = IndexReader.open(dir);
     searcher = new IndexSearcher(reader);
     hits = searcher.search(new TermQuery(searchTerm), null, 1000).scoreDocs;
     assertEquals("reader incorrectly sees changes from writer", 14, hits.length);
@@ -132,7 +132,7 @@ public class TestIndexWriterCommit exten
 
     TestIndexWriter.assertNoUnreferencedFiles(dir, "unreferenced files remain after rollback()");
 
-    reader = IndexReader.open(dir, false);
+    reader = IndexReader.open(dir);
     searcher = new IndexSearcher(reader);
     hits = searcher.search(new TermQuery(searchTerm), null, 1000).scoreDocs;
     assertEquals("saw changes after writer.abort", 14, hits.length);
@@ -152,7 +152,7 @@ public class TestIndexWriterCommit exten
       for(int j=0;j<17;j++) {
         TestIndexWriter.addDoc(writer);
       }
-      IndexReader r = IndexReader.open(dir, false);
+      IndexReader r = IndexReader.open(dir);
       searcher = new IndexSearcher(r);
       hits = searcher.search(new TermQuery(searchTerm), null, 1000).scoreDocs;
       assertEquals("reader incorrectly sees changes from writer", 14, hits.length);
@@ -161,7 +161,7 @@ public class TestIndexWriterCommit exten
     }
 
     writer.close();
-    IndexReader r = IndexReader.open(dir, false);
+    IndexReader r = IndexReader.open(dir);
     searcher = new IndexSearcher(r);
     hits = searcher.search(new TermQuery(searchTerm), null, 1000).scoreDocs;
     assertEquals("didn't see changes after close", 218, hits.length);
@@ -243,7 +243,7 @@ public class TestIndexWriterCommit exten
     writer.forceMerge(1);
     writer.close();
 
-    IndexReader.open(dir, true).close();
+    IndexReader.open(dir).close();
 
     long endDiskUsage = dir.getMaxUsedSizeInBytes();
 
@@ -287,7 +287,7 @@ public class TestIndexWriterCommit exten
     writer.forceMerge(1);
 
     // Open a reader before closing (commiting) the writer:
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
 
     // Reader should see index as multi-seg at this
     // point:
@@ -299,7 +299,7 @@ public class TestIndexWriterCommit exten
     TestIndexWriter.assertNoUnreferencedFiles(dir, "aborted writer after forceMerge");
 
     // Open a reader after aborting writer:
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
 
     // Reader should still see index as multi-segment
     assertTrue("Reader incorrectly sees one segment", reader.getSequentialSubReaders().length > 1);
@@ -318,7 +318,7 @@ public class TestIndexWriterCommit exten
     TestIndexWriter.assertNoUnreferencedFiles(dir, "aborted writer after forceMerge");
 
     // Open a reader after aborting writer:
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
 
     // Reader should see index as one segment
     assertEquals("Reader incorrectly sees more than one segment", 1, reader.getSequentialSubReaders().length);
@@ -398,7 +398,7 @@ public class TestIndexWriterCommit exten
     for (int i = 0; i < 23; i++)
       TestIndexWriter.addDoc(writer);
 
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     assertEquals(0, reader.numDocs());
     writer.commit();
     IndexReader reader2 = IndexReader.openIfChanged(reader);
@@ -411,12 +411,12 @@ public class TestIndexWriterCommit exten
       TestIndexWriter.addDoc(writer);
     assertEquals(23, reader2.numDocs());
     reader2.close();
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(23, reader.numDocs());
     reader.close();
     writer.commit();
 
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(40, reader.numDocs());
     reader.close();
     writer.close();
@@ -509,12 +509,12 @@ public class TestIndexWriterCommit exten
     for (int i = 0; i < 23; i++)
       TestIndexWriter.addDoc(writer);
 
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     assertEquals(0, reader.numDocs());
 
     writer.prepareCommit();
 
-    IndexReader reader2 = IndexReader.open(dir, true);
+    IndexReader reader2 = IndexReader.open(dir);
     assertEquals(0, reader2.numDocs());
 
     writer.commit();
@@ -532,18 +532,18 @@ public class TestIndexWriterCommit exten
 
     assertEquals(23, reader3.numDocs());
     reader3.close();
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(23, reader.numDocs());
     reader.close();
 
     writer.prepareCommit();
 
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(23, reader.numDocs());
     reader.close();
 
     writer.commit();
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(40, reader.numDocs());
     reader.close();
     writer.close();
@@ -566,12 +566,12 @@ public class TestIndexWriterCommit exten
     for (int i = 0; i < 23; i++)
       TestIndexWriter.addDoc(writer);
 
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     assertEquals(0, reader.numDocs());
 
     writer.prepareCommit();
 
-    IndexReader reader2 = IndexReader.open(dir, true);
+    IndexReader reader2 = IndexReader.open(dir);
     assertEquals(0, reader2.numDocs());
 
     writer.rollback();
@@ -587,18 +587,18 @@ public class TestIndexWriterCommit exten
     for (int i = 0; i < 17; i++)
       TestIndexWriter.addDoc(writer);
 
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(0, reader.numDocs());
     reader.close();
 
     writer.prepareCommit();
 
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(0, reader.numDocs());
     reader.close();
 
     writer.commit();
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(17, reader.numDocs());
     reader.close();
     writer.close();
@@ -614,7 +614,7 @@ public class TestIndexWriterCommit exten
     writer.commit();
     writer.close();
 
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     assertEquals(0, reader.numDocs());
     reader.close();
     dir.close();
@@ -630,7 +630,7 @@ public class TestIndexWriterCommit exten
 
     assertEquals(0, IndexReader.getCommitUserData(dir).size());
 
-    IndexReader r = IndexReader.open(dir, true);
+    IndexReader r = IndexReader.open(dir);
     // commit(Map) never called for this index
     assertEquals(0, r.getCommitUserData().size());
     r.close();
@@ -645,7 +645,7 @@ public class TestIndexWriterCommit exten
 
     assertEquals("test1", IndexReader.getCommitUserData(dir).get("label"));
 
-    r = IndexReader.open(dir, true);
+    r = IndexReader.open(dir);
     assertEquals("test1", r.getCommitUserData().get("label"));
     r.close();
 

Modified: lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java?rev=1210305&r1=1210304&r2=1210305&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java (original)
+++ lucene/dev/branches/lucene3606/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java Mon Dec  5 01:41:38 2011
@@ -106,7 +106,7 @@ public class TestIndexWriterDelete exten
 
     modifier.commit();
 
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     assertEquals(7, reader.numDocs());
     reader.close();
 
@@ -114,7 +114,7 @@ public class TestIndexWriterDelete exten
 
     modifier.commit();
 
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(0, reader.numDocs());
     reader.close();
     modifier.close();
@@ -166,7 +166,7 @@ public class TestIndexWriterDelete exten
       assertEquals(0, modifier.getSegmentCount());
       modifier.commit();
 
-      IndexReader reader = IndexReader.open(dir, true);
+      IndexReader reader = IndexReader.open(dir);
       assertEquals(1, reader.numDocs());
 
       int hitCount = getHitCount(dir, new Term("id", String.valueOf(id)));
@@ -204,7 +204,7 @@ public class TestIndexWriterDelete exten
 
     modifier.commit();
 
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     assertEquals(5, reader.numDocs());
     modifier.close();
     reader.close();
@@ -226,7 +226,7 @@ public class TestIndexWriterDelete exten
     }
     modifier.commit();
 
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     assertEquals(7, reader.numDocs());
     reader.close();
 
@@ -236,7 +236,7 @@ public class TestIndexWriterDelete exten
 
     modifier.commit();
 
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(5, reader.numDocs());
     reader.close();
 
@@ -246,7 +246,7 @@ public class TestIndexWriterDelete exten
     }
     modifier.deleteDocuments(terms);
     modifier.commit();
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(2, reader.numDocs());
     reader.close();
 
@@ -269,7 +269,7 @@ public class TestIndexWriterDelete exten
     }
     modifier.commit();
 
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     assertEquals(7, reader.numDocs());
     reader.close();
 
@@ -280,7 +280,7 @@ public class TestIndexWriterDelete exten
     modifier.deleteAll();
 
     // Delete all shouldn't be on disk yet
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(7, reader.numDocs());
     reader.close();
 
@@ -292,7 +292,7 @@ public class TestIndexWriterDelete exten
     modifier.commit();
 
     // Validate there are no docs left
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(2, reader.numDocs());
     reader.close();
 
@@ -317,7 +317,7 @@ public class TestIndexWriterDelete exten
 
     addDoc(modifier, ++id, value);
 
-    IndexReader reader = IndexReader.open(dir, true);
+    IndexReader reader = IndexReader.open(dir);
     assertEquals(7, reader.numDocs());
     reader.close();
 
@@ -329,7 +329,7 @@ public class TestIndexWriterDelete exten
     modifier.close();
 
     // Validate that the docs are still there
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(7, reader.numDocs());
     reader.close();
 
@@ -372,7 +372,7 @@ public class TestIndexWriterDelete exten
     modifier.close();
 
     // Validate that the docs are still there
-    reader = IndexReader.open(dir, true);
+    reader = IndexReader.open(dir);
     assertEquals(7, reader.numDocs());
     reader.close();
 
@@ -567,7 +567,7 @@ public class TestIndexWriterDelete exten
         // changed (transactional semantics):
         IndexReader newReader = null;
         try {
-          newReader = IndexReader.open(dir, true);
+          newReader = IndexReader.open(dir);
         }
         catch (IOException e) {
           e.printStackTrace();



Mime
View raw message