lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r821340 [3/3] - in /lucene/java/trunk: ./ src/test/org/apache/lucene/ src/test/org/apache/lucene/analysis/ src/test/org/apache/lucene/document/ src/test/org/apache/lucene/index/ src/test/org/apache/lucene/queryParser/ src/test/org/apache/lu...
Date Sat, 03 Oct 2009 15:45:37 GMT
Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java Sat Oct  3 15:45:34 2009
@@ -59,7 +59,7 @@
         writer.optimize();
         writer.close();
 
-        IndexSearcher searcher = new IndexSearcher(indexStore);
+        IndexSearcher searcher = new IndexSearcher(indexStore, true);
 
         // search for "blueberry pi*":
         MultiPhraseQuery query1 = new MultiPhraseQuery();
@@ -69,7 +69,7 @@
         query2.add(new Term("body", "strawberry"));
 
         LinkedList termsWithPrefix = new LinkedList();
-        IndexReader ir = IndexReader.open(indexStore);
+        IndexReader ir = IndexReader.open(indexStore, true);
 
         // this TermEnum gives "piccadilly", "pie" and "pizza".
         String prefix = "pi";
@@ -149,7 +149,7 @@
       writer.optimize();
       writer.close();
 
-      IndexSearcher searcher = new IndexSearcher(indexStore);
+      IndexSearcher searcher = new IndexSearcher(indexStore, true);
       // This query will be equivalent to +body:pie +body:"blue*"
       BooleanQuery q = new BooleanQuery();
       q.add(new TermQuery(new Term("body", "pie")), BooleanClause.Occur.MUST);
@@ -175,7 +175,7 @@
     add("a note", "note", writer);
     writer.close();
     
-    IndexSearcher searcher = new IndexSearcher(indexStore);
+    IndexSearcher searcher = new IndexSearcher(indexStore, true);
 
     // This query will be equivalent to +type:note +body:"a t*"
     BooleanQuery q = new BooleanQuery();

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java Sat Oct  3 15:45:34 2009
@@ -109,8 +109,8 @@
         // building the searchables
         Searcher[] searchers = new Searcher[2];
         // VITAL STEP:adding the searcher for the empty index first, before the searcher for the populated index
-        searchers[0] = new IndexSearcher(indexStoreB);
-        searchers[1] = new IndexSearcher(indexStoreA);
+        searchers[0] = new IndexSearcher(indexStoreB, true);
+        searchers[1] = new IndexSearcher(indexStoreA, true);
         // creating the multiSearcher
         Searcher mSearcher = getMultiSearcherInstance(searchers);
         // performing the search
@@ -138,8 +138,8 @@
         // building the searchables
         Searcher[] searchers2 = new Searcher[2];
         // VITAL STEP:adding the searcher for the empty index first, before the searcher for the populated index
-        searchers2[0] = new IndexSearcher(indexStoreB);
-        searchers2[1] = new IndexSearcher(indexStoreA);
+        searchers2[0] = new IndexSearcher(indexStoreB, true);
+        searchers2[1] = new IndexSearcher(indexStoreA, true);
         // creating the mulitSearcher
         MultiSearcher mSearcher2 = getMultiSearcherInstance(searchers2);
         // performing the same search
@@ -171,7 +171,7 @@
 
         // deleting the document just added, this will cause a different exception to take place
         Term term = new Term("id", "doc1");
-        IndexReader readerB = IndexReader.open(indexStoreB);
+        IndexReader readerB = IndexReader.open(indexStoreB, false);
         readerB.deleteDocuments(term);
         readerB.close();
 
@@ -183,8 +183,8 @@
         // building the searchables
         Searcher[] searchers3 = new Searcher[2];
 
-        searchers3[0] = new IndexSearcher(indexStoreB);
-        searchers3[1] = new IndexSearcher(indexStoreA);
+        searchers3[0] = new IndexSearcher(indexStoreB, true);
+        searchers3[1] = new IndexSearcher(indexStoreA, true);
         // creating the mulitSearcher
         Searcher mSearcher3 = getMultiSearcherInstance(searchers3);
         // performing the same search
@@ -241,8 +241,8 @@
     initIndex(ramDirectory1, 10, true, null); // documents with a single token "doc0", "doc1", etc...
     initIndex(ramDirectory2, 10, true, "x"); // documents with two tokens "doc0" and "x", "doc1" and x, etc...
 
-    indexSearcher1 = new IndexSearcher(ramDirectory1);
-    indexSearcher2 = new IndexSearcher(ramDirectory2);
+    indexSearcher1 = new IndexSearcher(ramDirectory1, true);
+    indexSearcher2 = new IndexSearcher(ramDirectory2, true);
 
     MultiSearcher searcher = getMultiSearcherInstance(new Searcher[]{indexSearcher1, indexSearcher2});
     assertTrue("searcher is null and it shouldn't be", searcher != null);
@@ -297,7 +297,7 @@
         initIndex(ramDirectory1, nDocs, true, null); // documents with a single token "doc0", "doc1", etc...
         initIndex(ramDirectory1, nDocs, false, "x"); // documents with two tokens "doc0" and "x", "doc1" and x, etc...
         
-        indexSearcher1=new IndexSearcher(ramDirectory1);
+        indexSearcher1=new IndexSearcher(ramDirectory1, true);
         indexSearcher1.setDefaultFieldSortScoring(true, true);
         
         hits=indexSearcher1.search(query, null, 1000).scoreDocs;
@@ -325,9 +325,9 @@
         initIndex(ramDirectory1, nDocs, true, null); // documents with a single token "doc0", "doc1", etc...
         initIndex(ramDirectory2, nDocs, true, "x"); // documents with two tokens "doc0" and "x", "doc1" and x, etc...
         
-        indexSearcher1=new IndexSearcher(ramDirectory1);
+        indexSearcher1=new IndexSearcher(ramDirectory1, true);
         indexSearcher1.setDefaultFieldSortScoring(true, true);
-        indexSearcher2=new IndexSearcher(ramDirectory2);
+        indexSearcher2=new IndexSearcher(ramDirectory2, true);
         indexSearcher2.setDefaultFieldSortScoring(true, true);
         
         Searcher searcher=getMultiSearcherInstance(new Searcher[] { indexSearcher1, indexSearcher2 });
@@ -363,7 +363,7 @@
     public void testCustomSimilarity () throws IOException {
         RAMDirectory dir = new RAMDirectory();
         initIndex(dir, 10, true, "x"); // documents with two tokens "doc0" and "x", "doc1" and x, etc...
-        IndexSearcher srchr = new IndexSearcher(dir);
+        IndexSearcher srchr = new IndexSearcher(dir, true);
         MultiSearcher msrchr = getMultiSearcherInstance(new Searcher[]{srchr});
         
         Similarity customSimilarity = new DefaultSimilarity() {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java Sat Oct  3 15:45:34 2009
@@ -125,8 +125,8 @@
     iw2.close();
 
     Searchable[] s = new Searchable[2];
-    s[0] = new IndexSearcher(d1);
-    s[1] = new IndexSearcher(d2);
+    s[0] = new IndexSearcher(d1, true);
+    s[1] = new IndexSearcher(d2, true);
     multiSearcher = new MultiSearcher(s);
 
     // create IndexSearcher which contains all documents
@@ -136,7 +136,7 @@
     addCollection1(iw);
     addCollection2(iw);
     iw.close();
-    singleSearcher = new IndexSearcher(d);
+    singleSearcher = new IndexSearcher(d, true);
   }
   
   private void addCollection1(IndexWriter iw) throws IOException {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java Sat Oct  3 15:45:34 2009
@@ -146,7 +146,7 @@
   public void testEqualScores() throws IOException {
     // NOTE: uses index build in *this* setUp
 
-    IndexReader reader = IndexReader.open(small);
+    IndexReader reader = IndexReader.open(small, true);
     IndexSearcher search = new IndexSearcher(reader);
 
     ScoreDoc[] result;
@@ -175,7 +175,7 @@
   public void testBoost() throws IOException {
     // NOTE: uses index build in *this* setUp
 
-    IndexReader reader = IndexReader.open(small);
+    IndexReader reader = IndexReader.open(small, true);
     IndexSearcher search = new IndexSearcher(reader);
 
     // test for correct application of query normalization
@@ -243,7 +243,7 @@
   public void testBooleanOrderUnAffected() throws IOException {
     // NOTE: uses index build in *this* setUp
 
-    IndexReader reader = IndexReader.open(small);
+    IndexReader reader = IndexReader.open(small, true);
     IndexSearcher search = new IndexSearcher(reader);
 
     // first do a regular TermRangeQuery which uses term expansion so
@@ -274,7 +274,7 @@
   public void testRangeQueryId() throws IOException {
     // NOTE: uses index build in *super* setUp
 
-    IndexReader reader = IndexReader.open(signedIndex.index);
+    IndexReader reader = IndexReader.open(signedIndex.index, true);
     IndexSearcher search = new IndexSearcher(reader);
 
     int medId = ((maxId - minId) / 2);
@@ -401,7 +401,7 @@
   public void testRangeQueryIdCollating() throws IOException {
     // NOTE: uses index build in *super* setUp
 
-    IndexReader reader = IndexReader.open(signedIndex.index);
+    IndexReader reader = IndexReader.open(signedIndex.index, true);
     IndexSearcher search = new IndexSearcher(reader);
 
     int medId = ((maxId - minId) / 2);
@@ -484,7 +484,7 @@
   public void testRangeQueryRand() throws IOException {
     // NOTE: uses index build in *super* setUp
 
-    IndexReader reader = IndexReader.open(signedIndex.index);
+    IndexReader reader = IndexReader.open(signedIndex.index, true);
     IndexSearcher search = new IndexSearcher(reader);
 
     String minRP = pad(signedIndex.minR);
@@ -547,7 +547,7 @@
     // NOTE: uses index build in *super* setUp
 
     // using the unsigned index because collation seems to ignore hyphens
-    IndexReader reader = IndexReader.open(unsignedIndex.index);
+    IndexReader reader = IndexReader.open(unsignedIndex.index, true);
     IndexSearcher search = new IndexSearcher(reader);
 
     String minRP = pad(unsignedIndex.minR);
@@ -624,7 +624,7 @@
     writer.optimize();
     writer.close();
 
-    IndexReader reader = IndexReader.open(farsiIndex);
+    IndexReader reader = IndexReader.open(farsiIndex, true);
     IndexSearcher search = new IndexSearcher(reader);
 
     // Neither Java 1.4.2 nor 1.5.0 has Farsi Locale collation available in
@@ -668,7 +668,7 @@
     writer.optimize();
     writer.close();
 
-    IndexReader reader = IndexReader.open(danishIndex);
+    IndexReader reader = IndexReader.open(danishIndex, true);
     IndexSearcher search = new IndexSearcher(reader);
 
     Collator c = Collator.getInstance(new Locale("da", "dk"));

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java Sat Oct  3 15:45:34 2009
@@ -62,7 +62,7 @@
     IndexReader reader = null;
     
     try {
-      reader = IndexReader.open(directory);
+      reader = IndexReader.open(directory, true);
       for(int i = 1; i <= numThreads; i++)
         testTermPositionVectors(reader, i);
       

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestNot.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestNot.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestNot.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestNot.java Sat Oct  3 15:45:34 2009
@@ -47,7 +47,7 @@
     writer.optimize();
     writer.close();
 
-    Searcher searcher = new IndexSearcher(store);
+    Searcher searcher = new IndexSearcher(store, true);
       QueryParser parser = new QueryParser("field", new SimpleAnalyzer());
     Query query = parser.parse("a NOT b");
     //System.out.println(query);

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java Sat Oct  3 15:45:34 2009
@@ -70,7 +70,7 @@
         writer.optimize();
         writer.close();
 
-        IndexSearcher searcher = new IndexSearcher(indexStore);
+        IndexSearcher searcher = new IndexSearcher(indexStore, true);
 
         //PhrasePrefixQuery query1 = new PhrasePrefixQuery();
         MultiPhraseQuery query1 = new MultiPhraseQuery();
@@ -80,7 +80,7 @@
         query2.add(new Term("body", "strawberry"));
 
         LinkedList termsWithPrefix = new LinkedList();
-        IndexReader ir = IndexReader.open(indexStore);
+        IndexReader ir = IndexReader.open(indexStore, true);
 
         // this TermEnum gives "piccadilly", "pie" and "pizza".
         String prefix = "pi";

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestPhraseQuery.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestPhraseQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestPhraseQuery.java Sat Oct  3 15:45:34 2009
@@ -77,7 +77,7 @@
     writer.optimize();
     writer.close();
 
-    searcher = new IndexSearcher(directory);
+    searcher = new IndexSearcher(directory, true);
     query = new PhraseQuery();
   }
 
@@ -209,7 +209,7 @@
     writer.addDocument(doc);
     writer.close();
 
-    IndexSearcher searcher = new IndexSearcher(directory);
+    IndexSearcher searcher = new IndexSearcher(directory, true);
 
     // valid exact phrase query
     PhraseQuery query = new PhraseQuery();
@@ -249,7 +249,7 @@
     writer.optimize();
     writer.close();
     
-    IndexSearcher searcher = new IndexSearcher(directory);
+    IndexSearcher searcher = new IndexSearcher(directory, true);
     
     PhraseQuery phraseQuery = new PhraseQuery();
     phraseQuery.add(new Term("source", "marketing"));
@@ -287,7 +287,7 @@
     writer.optimize();
     writer.close();
     
-    searcher = new IndexSearcher(directory);
+    searcher = new IndexSearcher(directory, true);
     
     termQuery = new TermQuery(new Term("contents","woo"));
     phraseQuery = new PhraseQuery();
@@ -338,7 +338,7 @@
     writer.optimize();
     writer.close();
 
-    Searcher searcher = new IndexSearcher(directory);
+    Searcher searcher = new IndexSearcher(directory, true);
     PhraseQuery query = new PhraseQuery();
     query.add(new Term("field", "firstname"));
     query.add(new Term("field", "lastname"));

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestPositionIncrement.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestPositionIncrement.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestPositionIncrement.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestPositionIncrement.java Sat Oct  3 15:45:34 2009
@@ -92,7 +92,7 @@
     writer.close();
     
 
-    IndexSearcher searcher = new IndexSearcher(store);
+    IndexSearcher searcher = new IndexSearcher(store, true);
     
     TermPositions pos = searcher.getIndexReader().termPositions(new Term("field", "1"));
     pos.next();

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixFilter.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixFilter.java Sat Oct  3 15:45:34 2009
@@ -48,7 +48,7 @@
     // PrefixFilter combined with ConstantScoreQuery
     PrefixFilter filter = new PrefixFilter(new Term("category", "/Computers"));
     Query query = new ConstantScoreQuery(filter);
-    IndexSearcher searcher = new IndexSearcher(directory);
+    IndexSearcher searcher = new IndexSearcher(directory, true);
     ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(4, hits.length);
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixQuery.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixQuery.java Sat Oct  3 15:45:34 2009
@@ -45,7 +45,7 @@
     writer.close();
 
     PrefixQuery query = new PrefixQuery(new Term("category", "/Computers"));
-    IndexSearcher searcher = new IndexSearcher(directory);
+    IndexSearcher searcher = new IndexSearcher(directory, true);
     ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("All documents in /Computers category and below", 3, hits.length);
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestSetNorm.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestSetNorm.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestSetNorm.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestSetNorm.java Sat Oct  3 15:45:34 2009
@@ -52,7 +52,7 @@
     writer.close();
 
     // reset the boost of each instance of this document
-    IndexReader reader = IndexReader.open(store);
+    IndexReader reader = IndexReader.open(store, false);
     reader.setNorm(0, "field", 1.0f);
     reader.setNorm(1, "field", 2.0f);
     reader.setNorm(2, "field", 4.0f);
@@ -62,7 +62,7 @@
     // check that searches are ordered by this boost
     final float[] scores = new float[4];
 
-    new IndexSearcher(store).search
+    new IndexSearcher(store, true).search
       (new TermQuery(new Term("field", "word")),
        new Collector() {
          private int base = 0;

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestSimilarity.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestSimilarity.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestSimilarity.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestSimilarity.java Sat Oct  3 15:45:34 2009
@@ -67,7 +67,7 @@
     writer.optimize();
     writer.close();
 
-    Searcher searcher = new IndexSearcher(store);
+    Searcher searcher = new IndexSearcher(store, true);
     searcher.setSimilarity(new SimpleSimilarity());
 
     Term a = new Term("field", "a");

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestSimpleExplanations.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestSimpleExplanations.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestSimpleExplanations.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestSimpleExplanations.java Sat Oct  3 15:45:34 2009
@@ -331,8 +331,8 @@
     Query query = parser.parse("handle:1");
 
     Searcher[] searchers = new Searcher[2];
-    searchers[0] = new IndexSearcher(indexStoreB);
-    searchers[1] = new IndexSearcher(indexStoreA);
+    searchers[0] = new IndexSearcher(indexStoreB, true);
+    searchers[1] = new IndexSearcher(indexStoreA, true);
     Searcher mSearcher = new MultiSearcher(searchers);
     ScoreDoc[] hits = mSearcher.search(query, null, 1000).scoreDocs;
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java Sat Oct  3 15:45:34 2009
@@ -122,7 +122,7 @@
     writer.addDocument(doc);
     writer.close();
 
-    IndexSearcher searcher = new IndexSearcher(ramDir);
+    IndexSearcher searcher = new IndexSearcher(ramDir, true);
     TopDocs td = searcher.search(query,null,10);
     //System.out.println("slop: "+slop+"  query: "+query+"  doc: "+doc+"  Expecting number of hits: "+expectedNumResults+" maxScore="+td.getMaxScore());
     assertEquals("slop: "+slop+"  query: "+query+"  doc: "+doc+"  Wrong number of hits", expectedNumResults, td.totalHits);

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestSort.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestSort.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestSort.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestSort.java Sat Oct  3 15:45:34 2009
@@ -624,19 +624,6 @@
     sort.setSort (new SortField ("i18n", new Locale("da", "dk")));
     assertMatches (multiSearcher, queryY, sort, "BJDHF");
   } 
-    
-  // test a custom sort function
-  public void testCustomSorts() throws Exception {
-    sort.setSort (new SortField ("custom", SampleComparable.getComparatorSource()));
-    assertMatches (full, queryX, sort, "CAIEG");
-    sort.setSort (new SortField ("custom", SampleComparable.getComparatorSource(), true));
-    assertMatches (full, queryY, sort, "HJDBF");
-    SortComparator custom = SampleComparable.getComparator();
-    sort.setSort (new SortField ("custom", custom));
-    assertMatches (full, queryX, sort, "CAIEG");
-    sort.setSort (new SortField ("custom", custom, true));
-    assertMatches (full, queryY, sort, "HJDBF");
-  }
 
   // test a variety of sorts using more than one searcher
   public void testMultiSort() throws Exception {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestSpanQueryFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestSpanQueryFilter.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestSpanQueryFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestSpanQueryFilter.java Sat Oct  3 15:45:34 2009
@@ -50,7 +50,7 @@
     }
     writer.close();
 
-    IndexReader reader = IndexReader.open(dir);
+    IndexReader reader = IndexReader.open(dir, true);
 
     SpanTermQuery query = new SpanTermQuery(new Term("field", English.intToEnglish(10).trim()));
     SpanQueryFilter filter = new SpanQueryFilter(query);

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestStressSort.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestStressSort.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestStressSort.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestStressSort.java Sat Oct  3 15:45:34 2009
@@ -165,20 +165,20 @@
       }
     }
     writer.close();
-    searcherMultiSegment = new IndexSearcher(dir);
+    searcherMultiSegment = new IndexSearcher(dir, true);
     searcherMultiSegment.setDefaultFieldSortScoring(true, true);
 
     dir2 = new MockRAMDirectory(dir);
     writer = new IndexWriter(dir2, new StandardAnalyzer(), IndexWriter.MaxFieldLength.LIMITED);
     writer.optimize();
     writer.close();
-    searcherSingleSegment = new IndexSearcher(dir2);
+    searcherSingleSegment = new IndexSearcher(dir2, true);
     searcherSingleSegment.setDefaultFieldSortScoring(true, true);
     dir3 = new MockRAMDirectory(dir);
     writer = new IndexWriter(dir3, new StandardAnalyzer(), IndexWriter.MaxFieldLength.LIMITED);
     writer.optimize(3);
     writer.close();
-    searcherFewSegment = new IndexSearcher(dir3);
+    searcherFewSegment = new IndexSearcher(dir3, true);
     searcherFewSegment.setDefaultFieldSortScoring(true, true);
   }
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestTermRangeFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestTermRangeFilter.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestTermRangeFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestTermRangeFilter.java Sat Oct  3 15:45:34 2009
@@ -49,7 +49,7 @@
 
     public void testRangeFilterId() throws IOException {
 
-        IndexReader reader = IndexReader.open(signedIndex.index);
+        IndexReader reader = IndexReader.open(signedIndex.index, true);
 	IndexSearcher search = new IndexSearcher(reader);
 
         int medId = ((maxId - minId) / 2);
@@ -131,7 +131,7 @@
 
     public void testRangeFilterIdCollating() throws IOException {
 
-        IndexReader reader = IndexReader.open(signedIndex.index);
+        IndexReader reader = IndexReader.open(signedIndex.index, true);
         IndexSearcher search = new IndexSearcher(reader);
 
         Collator c = Collator.getInstance(Locale.ENGLISH);
@@ -214,7 +214,7 @@
 
     public void testRangeFilterRand() throws IOException {
 
-  IndexReader reader = IndexReader.open(signedIndex.index);
+  IndexReader reader = IndexReader.open(signedIndex.index, true);
 	IndexSearcher search = new IndexSearcher(reader);
 
         String minRP = pad(signedIndex.minR);
@@ -277,7 +277,7 @@
     public void testRangeFilterRandCollating() throws IOException {
 
         // using the unsigned index because collation seems to ignore hyphens
-        IndexReader reader = IndexReader.open(unsignedIndex.index);
+        IndexReader reader = IndexReader.open(unsignedIndex.index, true);
         IndexSearcher search = new IndexSearcher(reader);
 
         Collator c = Collator.getInstance(Locale.ENGLISH);
@@ -354,7 +354,7 @@
         writer.optimize();
         writer.close();
 
-        IndexReader reader = IndexReader.open(farsiIndex);
+        IndexReader reader = IndexReader.open(farsiIndex, true);
         IndexSearcher search = new IndexSearcher(reader);
         Query q = new TermQuery(new Term("body","body"));
 
@@ -398,7 +398,7 @@
         writer.optimize();
         writer.close();
 
-        IndexReader reader = IndexReader.open(danishIndex);
+        IndexReader reader = IndexReader.open(danishIndex, true);
         IndexSearcher search = new IndexSearcher(reader);
         Query q = new TermQuery(new Term("body","body"));
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestTermRangeQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestTermRangeQuery.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestTermRangeQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestTermRangeQuery.java Sat Oct  3 15:45:34 2009
@@ -48,19 +48,19 @@
   public void testExclusive() throws Exception {
     Query query = new TermRangeQuery("content", "A", "C", false, false);
     initializeIndex(new String[] {"A", "B", "C", "D"});
-    IndexSearcher searcher = new IndexSearcher(dir);
+    IndexSearcher searcher = new IndexSearcher(dir, true);
     ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("A,B,C,D, only B in range", 1, hits.length);
     searcher.close();
 
     initializeIndex(new String[] {"A", "B", "D"});
-    searcher = new IndexSearcher(dir);
+    searcher = new IndexSearcher(dir, true);
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("A,B,D, only B in range", 1, hits.length);
     searcher.close();
 
     addDoc("C");
-    searcher = new IndexSearcher(dir);
+    searcher = new IndexSearcher(dir, true);
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("C added, still only B in range", 1, hits.length);
     searcher.close();
@@ -70,14 +70,14 @@
   public void testDeprecatedCstrctors() throws IOException {
     Query query = new RangeQuery(null, new Term("content","C"), false);
     initializeIndex(new String[] {"A", "B", "C", "D"});
-    IndexSearcher searcher = new IndexSearcher(dir);
+    IndexSearcher searcher = new IndexSearcher(dir, true);
     ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("A,B,C,D, only B in range", 2, hits.length);
     searcher.close();
     
     query = new RangeQuery(new Term("content","C"),null, false);
     initializeIndex(new String[] {"A", "B", "C", "D"});
-    searcher = new IndexSearcher(dir);
+    searcher = new IndexSearcher(dir, true);
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("A,B,C,D, only B in range", 1, hits.length);
     searcher.close();
@@ -87,19 +87,19 @@
     Query query = new TermRangeQuery("content", "A", "C", true, true);
 
     initializeIndex(new String[]{"A", "B", "C", "D"});
-    IndexSearcher searcher = new IndexSearcher(dir);
+    IndexSearcher searcher = new IndexSearcher(dir, true);
     ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("A,B,C,D - A,B,C in range", 3, hits.length);
     searcher.close();
 
     initializeIndex(new String[]{"A", "B", "D"});
-    searcher = new IndexSearcher(dir);
+    searcher = new IndexSearcher(dir, true);
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("A,B,D - A and B in range", 2, hits.length);
     searcher.close();
 
     addDoc("C");
-    searcher = new IndexSearcher(dir);
+    searcher = new IndexSearcher(dir, true);
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("C added - A, B, C in range", 3, hits.length);
     searcher.close();
@@ -154,19 +154,19 @@
   public void testExclusiveCollating() throws Exception {
     Query query = new TermRangeQuery("content", "A", "C", false, false, Collator.getInstance(Locale.ENGLISH));
     initializeIndex(new String[] {"A", "B", "C", "D"});
-    IndexSearcher searcher = new IndexSearcher(dir);
+    IndexSearcher searcher = new IndexSearcher(dir, true);
     ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("A,B,C,D, only B in range", 1, hits.length);
     searcher.close();
 
     initializeIndex(new String[] {"A", "B", "D"});
-    searcher = new IndexSearcher(dir);
+    searcher = new IndexSearcher(dir, true);
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("A,B,D, only B in range", 1, hits.length);
     searcher.close();
 
     addDoc("C");
-    searcher = new IndexSearcher(dir);
+    searcher = new IndexSearcher(dir, true);
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("C added, still only B in range", 1, hits.length);
     searcher.close();
@@ -176,19 +176,19 @@
     Query query = new TermRangeQuery("content", "A", "C",true, true, Collator.getInstance(Locale.ENGLISH));
 
     initializeIndex(new String[]{"A", "B", "C", "D"});
-    IndexSearcher searcher = new IndexSearcher(dir);
+    IndexSearcher searcher = new IndexSearcher(dir, true);
     ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("A,B,C,D - A,B,C in range", 3, hits.length);
     searcher.close();
 
     initializeIndex(new String[]{"A", "B", "D"});
-    searcher = new IndexSearcher(dir);
+    searcher = new IndexSearcher(dir, true);
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("A,B,D - A and B in range", 2, hits.length);
     searcher.close();
 
     addDoc("C");
-    searcher = new IndexSearcher(dir);
+    searcher = new IndexSearcher(dir, true);
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("C added - A, B, C in range", 3, hits.length);
     searcher.close();
@@ -205,7 +205,7 @@
     // index Term below should NOT be returned by a TermRangeQuery with a Farsi
     // Collator (or an Arabic one for the case when Farsi is not supported).
     initializeIndex(new String[]{ "\u0633\u0627\u0628"});
-    IndexSearcher searcher = new IndexSearcher(dir);
+    IndexSearcher searcher = new IndexSearcher(dir, true);
     ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("The index Term should not be included.", 0, hits.length);
 
@@ -225,7 +225,7 @@
     // Unicode order would not include "H\u00C5T" in [ "H\u00D8T", "MAND" ],
     // but Danish collation does.
     initializeIndex(words);
-    IndexSearcher searcher = new IndexSearcher(dir);
+    IndexSearcher searcher = new IndexSearcher(dir, true);
     ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("The index Term should be included.", 1, hits.length);
 
@@ -318,7 +318,7 @@
     Query query = new TermRangeQuery("content", null, "C",
                                  false, false);
     initializeIndex(new String[] {"A", "B", "", "C", "D"}, analyzer);
-    IndexSearcher searcher = new IndexSearcher(dir);
+    IndexSearcher searcher = new IndexSearcher(dir, true);
     Hits hits = searcher.search(query);
     // When Lucene-38 is fixed, use the assert on the next line:
     assertEquals("A,B,<empty string>,C,D => A, B & <empty string> are in range", 3, hits.length());
@@ -327,7 +327,7 @@
 
     searcher.close();
     initializeIndex(new String[] {"A", "B", "", "D"}, analyzer);
-    searcher = new IndexSearcher(dir);
+    searcher = new IndexSearcher(dir, true);
     hits = searcher.search(query);
     // When Lucene-38 is fixed, use the assert on the next line:
     assertEquals("A,B,<empty string>,D => A, B & <empty string> are in range", 3, hits.length());
@@ -335,7 +335,7 @@
     //assertEquals("A,B,<empty string>,D => A, B & <empty string> are in range", 2, hits.length());
     searcher.close();
     addDoc("C");
-    searcher = new IndexSearcher(dir);
+    searcher = new IndexSearcher(dir, true);
     hits = searcher.search(query);
     // When Lucene-38 is fixed, use the assert on the next line:
     assertEquals("C added, still A, B & <empty string> are in range", 3, hits.length());
@@ -350,7 +350,7 @@
     Analyzer analyzer = new SingleCharAnalyzer();
     Query query = new TermRangeQuery("content", null, "C", true, true);
     initializeIndex(new String[]{"A", "B", "","C", "D"}, analyzer);
-    IndexSearcher searcher = new IndexSearcher(dir);
+    IndexSearcher searcher = new IndexSearcher(dir, true);
     Hits hits = searcher.search(query);
     // When Lucene-38 is fixed, use the assert on the next line:
     assertEquals("A,B,<empty string>,C,D => A,B,<empty string>,C in range", 4, hits.length());
@@ -358,7 +358,7 @@
     //assertEquals("A,B,<empty string>,C,D => A,B,<empty string>,C in range", 3, hits.length());
     searcher.close();
     initializeIndex(new String[]{"A", "B", "", "D"}, analyzer);
-    searcher = new IndexSearcher(dir);
+    searcher = new IndexSearcher(dir, true);
     hits = searcher.search(query);
     // When Lucene-38 is fixed, use the assert on the next line:
     assertEquals("A,B,<empty string>,D - A, B and <empty string> in range", 3, hits.length());
@@ -366,7 +366,7 @@
     //assertEquals("A,B,<empty string>,D => A, B and <empty string> in range", 2, hits.length());
     searcher.close();
     addDoc("C");
-    searcher = new IndexSearcher(dir);
+    searcher = new IndexSearcher(dir, true);
     hits = searcher.search(query);
     // When Lucene-38 is fixed, use the assert on the next line:
     assertEquals("C added => A,B,<empty string>,C in range", 4, hits.length());

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestTermScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestTermScorer.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestTermScorer.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestTermScorer.java Sat Oct  3 15:45:34 2009
@@ -58,7 +58,7 @@
             writer.addDocument(doc);
         }
         writer.close();
-        indexSearcher = new IndexSearcher(directory);
+        indexSearcher = new IndexSearcher(directory, false);
         indexReader = indexSearcher.getIndexReader();
 
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestTermVectors.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestTermVectors.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestTermVectors.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestTermVectors.java Sat Oct  3 15:45:34 2009
@@ -67,7 +67,7 @@
       writer.addDocument(doc);
     }
     writer.close();
-    searcher = new IndexSearcher(directory);
+    searcher = new IndexSearcher(directory, true);
   }
 
   public void test() {
@@ -101,7 +101,7 @@
     doc.add(new Field("x", "some content here", Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS));
     writer.addDocument(doc);
     writer.close();
-    IndexReader reader = IndexReader.open(dir);
+    IndexReader reader = IndexReader.open(dir, true);
     TermFreqVector[] v = reader.getTermFreqVectors(0);
     assertEquals(4, v.length);
     String[] expectedFields = new String[]{"a", "b", "c", "x"};
@@ -240,7 +240,7 @@
       writer.addDocument(testDoc3);
       writer.addDocument(testDoc4);
       writer.close();
-      IndexSearcher knownSearcher = new IndexSearcher(dir);
+      IndexSearcher knownSearcher = new IndexSearcher(dir, true);
       TermEnum termEnum = knownSearcher.reader.terms();
       TermDocs termDocs = knownSearcher.reader.termDocs();
       //System.out.println("Terms: " + termEnum.size() + " Orig Len: " + termArray.length);
@@ -366,7 +366,7 @@
     }
 
     writer.close();
-    searcher = new IndexSearcher(directory);
+    searcher = new IndexSearcher(directory, true);
 
     Query query = new TermQuery(new Term("field", "hundred"));
     ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
@@ -398,7 +398,7 @@
     writer.addDocument(doc);
     writer.close();
 
-    searcher = new IndexSearcher(directory);
+    searcher = new IndexSearcher(directory, true);
 
     Query query = new TermQuery(new Term("field", "one"));
     ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestThreadSafe.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestThreadSafe.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestThreadSafe.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestThreadSafe.java Sat Oct  3 15:45:34 2009
@@ -151,7 +151,7 @@
 
     // do many small tests so the thread locals go away inbetween
     for (int i=0; i<100; i++) {
-      ir1 = IndexReader.open(dir1);
+      ir1 = IndexReader.open(dir1, false);
       doTest(10,100);
     }
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java Sat Oct  3 15:45:34 2009
@@ -79,7 +79,7 @@
       add(docText[i%docText.length], iw);
     }
     iw.close();
-    searcher = new IndexSearcher(directory);
+    searcher = new IndexSearcher(directory, true);
 
     String qtxt = "one";
     for (int i = 0; i < docText.length; i++) {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestTopDocsCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestTopDocsCollector.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestTopDocsCollector.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestTopDocsCollector.java Sat Oct  3 15:45:34 2009
@@ -91,7 +91,7 @@
 
   private TopDocsCollector doSearch(int numResults) throws IOException {
     Query q = new MatchAllDocsQuery();
-    IndexSearcher searcher = new IndexSearcher(dir);
+    IndexSearcher searcher = new IndexSearcher(dir, true);
     TopDocsCollector tdc = new MyTopsDocCollector(numResults);
     searcher.search(q, tdc);
     searcher.close();

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestTopScoreDocCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestTopScoreDocCollector.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestTopScoreDocCollector.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestTopScoreDocCollector.java Sat Oct  3 15:45:34 2009
@@ -64,7 +64,7 @@
     bq.setMinimumNumberShouldMatch(1);
     try {
       
-      IndexSearcher searcher = new IndexSearcher(dir);
+      IndexSearcher searcher = new IndexSearcher(dir, true);
       for (int i = 0; i < inOrder.length; i++) {
         TopDocsCollector tdc = TopScoreDocCollector.create(3, inOrder[i]);
         assertEquals("org.apache.lucene.search.TopScoreDocCollector$" + actualTSDCClass[i], tdc.getClass().getName());

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.java Sat Oct  3 15:45:34 2009
@@ -65,7 +65,7 @@
    */
   public void testTermWithoutWildcard() throws IOException {
       RAMDirectory indexStore = getIndexStore("field", new String[]{"nowildcard", "nowildcardx"});
-      IndexSearcher searcher = new IndexSearcher(indexStore);
+      IndexSearcher searcher = new IndexSearcher(indexStore, true);
 
       Query wq = new WildcardQuery(new Term("field", "nowildcard"));
       assertMatches(searcher, wq, 1);
@@ -81,7 +81,7 @@
       throws IOException {
     RAMDirectory indexStore = getIndexStore("body", new String[]
     {"metal", "metals"});
-    IndexSearcher searcher = new IndexSearcher(indexStore);
+    IndexSearcher searcher = new IndexSearcher(indexStore, true);
     Query query1 = new TermQuery(new Term("body", "metal"));
     Query query2 = new WildcardQuery(new Term("body", "metal*"));
     Query query3 = new WildcardQuery(new Term("body", "m*tal"));
@@ -120,7 +120,7 @@
       throws IOException {
     RAMDirectory indexStore = getIndexStore("body", new String[]
     {"metal", "metals", "mXtals", "mXtXls"});
-    IndexSearcher searcher = new IndexSearcher(indexStore);
+    IndexSearcher searcher = new IndexSearcher(indexStore, true);
     Query query1 = new WildcardQuery(new Term("body", "m?tal"));
     Query query2 = new WildcardQuery(new Term("body", "metal?"));
     Query query3 = new WildcardQuery(new Term("body", "metals?"));
@@ -205,7 +205,7 @@
     }
     iw.close();
     
-    IndexSearcher searcher = new IndexSearcher(dir);
+    IndexSearcher searcher = new IndexSearcher(dir, true);
     
     // test queries that must find all
     for (int i = 0; i < matchAll.length; i++) {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/function/TestCustomScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/function/TestCustomScoreQuery.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/function/TestCustomScoreQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/function/TestCustomScoreQuery.java Sat Oct  3 15:45:34 2009
@@ -137,7 +137,7 @@
   // Test that FieldScoreQuery returns docs with expected score.
   private void doTestCustomScore (String field, FieldScoreQuery.Type tp, double dboost) throws CorruptIndexException, Exception {
     float boost = (float) dboost;
-    IndexSearcher s = new IndexSearcher(dir);
+    IndexSearcher s = new IndexSearcher(dir, true);
     FieldScoreQuery qValSrc = new FieldScoreQuery(field,tp); // a query that would score by the field
     QueryParser qp = new QueryParser(TEXT_FIELD,anlzr); 
     String qtxt = "first aid text"; // from the doc texts in FunctionQuerySetup.

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/function/TestFieldScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/function/TestFieldScoreQuery.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/function/TestFieldScoreQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/function/TestFieldScoreQuery.java Sat Oct  3 15:45:34 2009
@@ -72,7 +72,7 @@
 
   // Test that FieldScoreQuery returns docs in expected order.
   private void doTestRank (String field, FieldScoreQuery.Type tp) throws CorruptIndexException, Exception {
-    IndexSearcher s = new IndexSearcher(dir);
+    IndexSearcher s = new IndexSearcher(dir, true);
     Query q = new FieldScoreQuery(field,tp);
     log("test: "+q);
     QueryUtils.check(q,s);
@@ -115,7 +115,7 @@
 
   // Test that FieldScoreQuery returns docs with expected score.
   private void doTestExactScore (String field, FieldScoreQuery.Type tp) throws CorruptIndexException, Exception {
-    IndexSearcher s = new IndexSearcher(dir);
+    IndexSearcher s = new IndexSearcher(dir, true);
     Query q = new FieldScoreQuery(field,tp);
     TopDocs td = s.search(q,null,1000);
     assertEquals("All docs should be matched!",N_DOCS,td.totalHits);
@@ -163,7 +163,7 @@
     expectedArrayTypes.put(FieldScoreQuery.Type.INT, new int[0]);
     expectedArrayTypes.put(FieldScoreQuery.Type.FLOAT, new float[0]);
     
-    IndexSearcher s = new IndexSearcher(dir);
+    IndexSearcher s = new IndexSearcher(dir, true);
     Object innerArray = null;
 
     boolean warned = false; // print warning once.
@@ -199,7 +199,7 @@
     }
     
     // verify new values are reloaded (not reused) for a new reader
-    s = new IndexSearcher(dir);
+    s = new IndexSearcher(dir, true);
     FieldScoreQuery q = new FieldScoreQuery(field,tp);
     ScoreDoc[] h = s.search(q, null, 1000).scoreDocs;
     assertEquals("All docs should be matched!",N_DOCS,h.length);

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/function/TestOrdValues.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/function/TestOrdValues.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/function/TestOrdValues.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/function/TestOrdValues.java Sat Oct  3 15:45:34 2009
@@ -55,7 +55,7 @@
 
   // Test that queries based on reverse/ordFieldScore scores correctly
   private void doTestRank (String field, boolean inOrder) throws CorruptIndexException, Exception {
-    IndexSearcher s = new IndexSearcher(dir);
+    IndexSearcher s = new IndexSearcher(dir, true);
     ValueSource vs;
     if (inOrder) {
       vs = new MultiValueSource(new OrdFieldSource(field));
@@ -98,7 +98,7 @@
   
   // Test that queries based on reverse/ordFieldScore returns docs with expected score.
   private void doTestExactScore (String field, boolean inOrder) throws CorruptIndexException, Exception {
-    IndexSearcher s = new IndexSearcher(dir);
+    IndexSearcher s = new IndexSearcher(dir, true);
     ValueSource vs;
     if (inOrder) {
       vs = new OrdFieldSource(field);
@@ -135,7 +135,7 @@
 
   // Test that values loaded for FieldScoreQuery are cached properly and consumes the proper RAM resources.
   private void doTestCaching (String field, boolean inOrder) throws CorruptIndexException, Exception {
-    IndexSearcher s = new IndexSearcher(dir);
+    IndexSearcher s = new IndexSearcher(dir, true);
     Object innerArray = null;
 
     boolean warned = false; // print warning once
@@ -205,7 +205,7 @@
     }
 
     // verify new values are reloaded (not reused) for a new reader
-    s = new IndexSearcher(dir);
+    s = new IndexSearcher(dir, true);
     if (inOrder) {
       vs = new OrdFieldSource(field);
     } else {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/payloads/PayloadHelper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/payloads/PayloadHelper.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/payloads/PayloadHelper.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/payloads/PayloadHelper.java Sat Oct  3 15:45:34 2009
@@ -116,7 +116,7 @@
     //writer.optimize();
     writer.close();
 
-    IndexSearcher searcher = new IndexSearcher(directory);
+    IndexSearcher searcher = new IndexSearcher(directory, true);
     searcher.setSimilarity(similarity);
     return searcher;
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java Sat Oct  3 15:45:34 2009
@@ -65,7 +65,7 @@
 
     writer.close();
 
-    searcher = new IndexSearcher(directory);
+    searcher = new IndexSearcher(directory, true);
   }
   
   public void testTerm() throws Exception {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java Sat Oct  3 15:45:34 2009
@@ -117,7 +117,7 @@
                                          field("last",   "jones")     }));
     
     writer.close();
-    searcher = new IndexSearcher(directory);
+    searcher = new IndexSearcher(directory, true);
   }
 
   public void tearDown() throws Exception {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java Sat Oct  3 15:45:34 2009
@@ -53,7 +53,7 @@
       writer.addDocument(doc);
     }
     writer.close();
-    searcher = new IndexSearcher(directory);
+    searcher = new IndexSearcher(directory, true);
   }
 
   protected String[] docFields = {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java Sat Oct  3 15:45:34 2009
@@ -125,7 +125,7 @@
 
     writer.close();
 
-    IndexSearcher searcher = new IndexSearcher(directory);
+    IndexSearcher searcher = new IndexSearcher(directory, true);
     searcher.setSimilarity(similarity);
     return searcher;
 
@@ -261,7 +261,7 @@
     writer.addDocument(doc);
     writer.close();
 
-    IndexSearcher is = new IndexSearcher(directory);
+    IndexSearcher is = new IndexSearcher(directory, true);
 
     SpanTermQuery stq1 = new SpanTermQuery(new Term("content", "a"));
     SpanTermQuery stq2 = new SpanTermQuery(new Term("content", "k"));
@@ -295,7 +295,7 @@
     writer.addDocument(doc);
     writer.close();
 
-    IndexSearcher is = new IndexSearcher(directory);
+    IndexSearcher is = new IndexSearcher(directory, true);
 
     SpanTermQuery stq1 = new SpanTermQuery(new Term("content", "a"));
     SpanTermQuery stq2 = new SpanTermQuery(new Term("content", "k"));
@@ -329,7 +329,7 @@
     writer.addDocument(doc);
     writer.close();
 
-    IndexSearcher is = new IndexSearcher(directory);
+    IndexSearcher is = new IndexSearcher(directory, true);
 
     SpanTermQuery stq1 = new SpanTermQuery(new Term("content", "a"));
     SpanTermQuery stq2 = new SpanTermQuery(new Term("content", "k"));
@@ -370,7 +370,7 @@
   
     writer.close();
 
-    IndexSearcher searcher = new IndexSearcher(directory);
+    IndexSearcher searcher = new IndexSearcher(directory, true);
 
     IndexReader reader = searcher.getIndexReader();
     PayloadSpanUtil psu = new PayloadSpanUtil(reader);
@@ -439,7 +439,7 @@
 
     writer.close();
 
-    IndexSearcher searcher = new IndexSearcher(directory);
+    IndexSearcher searcher = new IndexSearcher(directory, true);
     return searcher;
   }
   

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java Sat Oct  3 15:45:34 2009
@@ -56,7 +56,7 @@
       writer.addDocument(doc);
     }
     writer.close();
-    searcher = new IndexSearcher(directory);
+    searcher = new IndexSearcher(directory, true);
   }
 
   private String[] docFields = {
@@ -459,7 +459,7 @@
     writer.close();
 
     // Get searcher
-    final IndexReader reader = IndexReader.open(dir);
+    final IndexReader reader = IndexReader.open(dir, true);
     final IndexSearcher searcher = new IndexSearcher(reader);
 
     // Control (make sure docs indexed)

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java Sat Oct  3 15:45:34 2009
@@ -61,7 +61,7 @@
         addDocument(writer, "3", "I think it should work.");
         addDocument(writer, "4", "I think it should work.");
         writer.close();
-        searcher = new IndexSearcher(mDirectory);
+        searcher = new IndexSearcher(mDirectory, true);
     }
 
     protected void tearDown() throws Exception {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpansAdvanced2.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpansAdvanced2.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpansAdvanced2.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpansAdvanced2.java Sat Oct  3 15:45:34 2009
@@ -47,7 +47,7 @@
         writer.close();
 
         // re-open the searcher since we added more docs
-        searcher2 = new IndexSearcher(mDirectory);
+        searcher2 = new IndexSearcher(mDirectory, true);
     }
 
     /**
@@ -56,7 +56,7 @@
      * @throws Exception
      */
     public void testVerifyIndex() throws Exception {
-        final IndexReader reader = IndexReader.open(mDirectory);
+        final IndexReader reader = IndexReader.open(mDirectory, true);
         assertEquals(8, reader.numDocs());
         reader.close();
     }

Modified: lucene/java/trunk/src/test/org/apache/lucene/store/MockRAMDirectory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/store/MockRAMDirectory.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/store/MockRAMDirectory.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/store/MockRAMDirectory.java Sat Oct  3 15:45:34 2009
@@ -67,18 +67,10 @@
     super();
     init();
   }
-  public MockRAMDirectory(String dir) throws IOException {
-    super(dir);
-    init();
-  }
   public MockRAMDirectory(Directory dir) throws IOException {
     super(dir);
     init();
   }
-  public MockRAMDirectory(File dir) throws IOException {
-    super(dir);
-    init();
-  }
 
   /** If set to true, we throw an IOException if the same
    *  file is opened by createOutput, ever. */

Modified: lucene/java/trunk/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/store/TestBufferedIndexInput.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/store/TestBufferedIndexInput.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/store/TestBufferedIndexInput.java Sat Oct  3 15:45:34 2009
@@ -256,7 +256,7 @@
 
         dir.allIndexInputs.clear();
 
-        IndexReader reader = IndexReader.open(dir);
+        IndexReader reader = IndexReader.open(dir, false);
         Term aaa = new Term("content", "aaa");
         Term bbb = new Term("content", "bbb");
         Term ccc = new Term("content", "ccc");

Modified: lucene/java/trunk/src/test/org/apache/lucene/store/TestLockFactory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/store/TestLockFactory.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/store/TestLockFactory.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/store/TestLockFactory.java Sat Oct  3 15:45:34 2009
@@ -297,38 +297,6 @@
         _TestUtil.rmDir(indexDirName);
     }
 
-    // Verify: if I try to getDirectory() with two different locking implementations, I get an IOException
-    public void testFSDirectoryDifferentLockFactory() throws IOException {
-        File indexDirName = _TestUtil.getTempDir("index.TestLockFactory5");
-
-        LockFactory lf = new SingleInstanceLockFactory();
-        FSDirectory fs1 = FSDirectory.getDirectory(indexDirName, lf);
-
-        // Different lock factory instance should hit IOException:
-        try {
-          FSDirectory.getDirectory(indexDirName, new SingleInstanceLockFactory());
-          fail("Should have hit an IOException because LockFactory instances differ");
-        } catch (IOException e) {
-        }
-
-        FSDirectory fs2 = null;
-
-        // Same lock factory instance should not:
-        try {
-            fs2 = FSDirectory.getDirectory(indexDirName, lf);
-        } catch (IOException e) {
-            e.printStackTrace(System.out);
-            fail("Should not have hit an IOException because LockFactory instances are the same");
-        }
-
-        fs1.close();
-        if (fs2 != null) {
-            fs2.close();
-        }
-        // Cleanup
-        _TestUtil.rmDir(indexDirName);
-    }
-
     // Verify: do stress test, by opening IndexReaders and
     // IndexWriters over & over in 2 threads and making sure
     // no unexpected exceptions are raised:
@@ -499,7 +467,7 @@
             Query query = new TermQuery(new Term("content", "aaa"));
             for(int i=0;i<this.numIteration;i++) {
                 try{
-                    searcher = new IndexSearcher(dir);
+                    searcher = new IndexSearcher(dir, false);
                 } catch (Exception e) {
                     hitException = true;
                     System.out.println("Stress Test Index Searcher: create hit unexpected exception: " + e.toString());

Modified: lucene/java/trunk/src/test/org/apache/lucene/store/TestRAMDirectory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/store/TestRAMDirectory.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/store/TestRAMDirectory.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/store/TestRAMDirectory.java Sat Oct  3 15:45:34 2009
@@ -80,57 +80,7 @@
     assertEquals(ramDir.sizeInBytes(), ramDir.getRecomputedSizeInBytes());
     
     // open reader to test document count
-    IndexReader reader = IndexReader.open(ramDir);
-    assertEquals(docsToAdd, reader.numDocs());
-    
-    // open search zo check if all doc's are there
-    IndexSearcher searcher = new IndexSearcher(reader);
-    
-    // search for all documents
-    for (int i = 0; i < docsToAdd; i++) {
-      Document doc = searcher.doc(i);
-      assertTrue(doc.getField("content") != null);
-    }
-
-    // cleanup
-    reader.close();
-    searcher.close();
-  }
-
-  public void testRAMDirectoryFile () throws IOException {
-    
-    MockRAMDirectory ramDir = new MockRAMDirectory(indexDir);
-    
-    // Check size
-    assertEquals(ramDir.sizeInBytes(), ramDir.getRecomputedSizeInBytes());
-    
-    // open reader to test document count
-    IndexReader reader = IndexReader.open(ramDir);
-    assertEquals(docsToAdd, reader.numDocs());
-    
-    // open search zo check if all doc's are there
-    IndexSearcher searcher = new IndexSearcher(reader);
-    
-    // search for all documents
-    for (int i = 0; i < docsToAdd; i++) {
-      Document doc = searcher.doc(i);
-      assertTrue(doc.getField("content") != null);
-    }
-
-    // cleanup
-    reader.close();
-    searcher.close();
-  }
-  
-  public void testRAMDirectoryString () throws IOException {
-    
-    MockRAMDirectory ramDir = new MockRAMDirectory(indexDir.getCanonicalPath());
-    
-    // Check size
-    assertEquals(ramDir.sizeInBytes(), ramDir.getRecomputedSizeInBytes());
-    
-    // open reader to test document count
-    IndexReader reader = IndexReader.open(ramDir);
+    IndexReader reader = IndexReader.open(ramDir, true);
     assertEquals(docsToAdd, reader.numDocs());
     
     // open search zo check if all doc's are there
@@ -152,7 +102,10 @@
   
   public void testRAMDirectorySize() throws IOException, InterruptedException {
       
-    final MockRAMDirectory ramDir = new MockRAMDirectory(indexDir.getCanonicalPath());
+    Directory dir = FSDirectory.open(indexDir);
+    final MockRAMDirectory ramDir = new MockRAMDirectory(dir);
+    dir.close();
+    
     final IndexWriter writer  = new IndexWriter(ramDir, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
     writer.optimize();
     

Modified: lucene/java/trunk/src/test/org/apache/lucene/store/TestWindowsMMap.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/store/TestWindowsMMap.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/store/TestWindowsMMap.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/store/TestWindowsMMap.java Sat Oct  3 15:45:34 2009
@@ -71,7 +71,7 @@
 		StandardAnalyzer analyzer = new StandardAnalyzer(new HashSet());
 		// TODO: something about lock timeouts and leftover locks.
 		IndexWriter writer = new IndexWriter(storeDirectory, analyzer, true, IndexWriter.MaxFieldLength.LIMITED);
-		IndexSearcher searcher = new IndexSearcher(storePathname);
+		IndexSearcher searcher = new IndexSearcher(storeDirectory, true);
 		
 		for(int dx = 0; dx < 1000; dx ++) {
 			String f = randomField();

Modified: lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java Sat Oct  3 15:45:34 2009
@@ -50,8 +50,6 @@
  */
 public abstract class LuceneTestCase extends TestCase {
 
-  private boolean savedAPISetting = false;
-
   public LuceneTestCase() {
     super();
   }
@@ -63,9 +61,6 @@
   protected void setUp() throws Exception {
     super.setUp();
     ConcurrentMergeScheduler.setTestMode();
-    
-    savedAPISetting = TokenStream.getOnlyUseNewAPI();
-    TokenStream.setOnlyUseNewAPI(false);
   }
 
   /**
@@ -104,7 +99,6 @@
       purgeFieldCache(FieldCache.DEFAULT);
     }
     
-    TokenStream.setOnlyUseNewAPI(savedAPISetting);
     super.tearDown();
   }
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/util/TestFieldCacheSanityChecker.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/util/TestFieldCacheSanityChecker.java?rev=821340&r1=821339&r2=821340&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/util/TestFieldCacheSanityChecker.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/util/TestFieldCacheSanityChecker.java Sat Oct  3 15:45:34 2009
@@ -71,8 +71,8 @@
     }
     wA.close();
     wB.close();
-    readerA = IndexReader.open(dirA);
-    readerB = IndexReader.open(dirB);
+    readerA = IndexReader.open(dirA, true);
+    readerB = IndexReader.open(dirB, true);
     readerX = new MultiReader(new IndexReader[] { readerA, readerB });
   }
 



Mime
View raw message