lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r825626 - in /lucene/java/branches/flex_1458_2_9_back_compat_tests: ./ src/java/org/apache/lucene/index/ src/test/org/apache/lucene/analysis/ src/test/org/apache/lucene/document/ src/test/org/apache/lucene/index/ src/test/org/apache/lucene/...
Date Thu, 15 Oct 2009 19:55:38 GMT
Author: markrmiller
Date: Thu Oct 15 19:55:36 2009
New Revision: 825626

URL: http://svn.apache.org/viewvc?rev=825626&view=rev
Log:
merge up to r825599

Modified:
    lucene/java/branches/flex_1458_2_9_back_compat_tests/   (props changed)
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/java/org/apache/lucene/index/IndexReader.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java   (props changed)
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/document/TestDateTools.java   (props changed)
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/document/TestNumberTools.java   (props changed)
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/DocHelper.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java   (props changed)
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestCrash.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDoc.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDocumentWriter.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReader.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMerging.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestMultiReader.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestNorms.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestPayloads.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestSegmentMerger.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestSegmentReader.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestTermVectorsReader.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestThreadedOptimize.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/queryParser/TestQueryParser.java   (props changed)
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/search/TestPositionIncrement.java
    lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/store/TestRAMDirectory.java

Propchange: lucene/java/branches/flex_1458_2_9_back_compat_tests/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 15 19:55:36 2009
@@ -1,2 +1,3 @@
 /lucene/java/branches/lucene_2_4:748824
+/lucene/java/branches/lucene_2_9_back_compat_tests:824919-825624
 /lucene/java/trunk:821379

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/java/org/apache/lucene/index/IndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/java/org/apache/lucene/index/IndexReader.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/java/org/apache/lucene/index/IndexReader.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/java/org/apache/lucene/index/IndexReader.java Thu Oct 15 19:55:36 2009
@@ -1460,8 +1460,7 @@
     return null;
   }
 
-  /** Expert    
-   *  @deprecated */
+  /** Expert */
   public Object getFieldCacheKey() {
     return this;
   }

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java Thu Oct 15 19:55:36 2009
@@ -71,8 +71,7 @@
    *  you call optimize()) then in the worst case this could
    *  consume an extra 1X of your total index size, until
    *  you release the snapshot. */
-  // TODO 3.0: change this to return IndexCommit instead
-  public synchronized IndexCommitPoint snapshot() {
+  public synchronized IndexCommit snapshot() {
     if (snapshot == null)
       snapshot = lastCommit.getSegmentsFileName();
     else

Propchange: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 15 19:55:36 2009
@@ -1 +1,2 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:748824
+/lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:824919-825624

Propchange: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/document/TestDateTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 15 19:55:36 2009
@@ -1 +1,2 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestDateTools.java:748824
+/lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/document/TestDateTools.java:824919-825624

Propchange: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/document/TestNumberTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 15 19:55:36 2009
@@ -1 +1,2 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestNumberTools.java:748824
+/lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/document/TestNumberTools.java:824919-825624

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/DocHelper.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/DocHelper.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/DocHelper.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/DocHelper.java Thu Oct 15 19:55:36 2009
@@ -238,7 +238,7 @@
     writer.setSimilarity(similarity);
     //writer.setUseCompoundFile(false);
     writer.addDocument(doc);
-    writer.flush();
+    writer.commit();
     SegmentInfo info = writer.newestSegment();
     writer.close();
     return info;

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java Thu Oct 15 19:55:36 2009
@@ -43,27 +43,27 @@
     writer = newWriter(dir, true);
     // add 100 documents
     addDocs(writer, 100);
-    assertEquals(100, writer.docCount());
+    assertEquals(100, writer.maxDoc());
     writer.close();
 
     writer = newWriter(aux, true);
     writer.setUseCompoundFile(false); // use one without a compound file
     // add 40 documents in separate files
     addDocs(writer, 40);
-    assertEquals(40, writer.docCount());
+    assertEquals(40, writer.maxDoc());
     writer.close();
 
     writer = newWriter(aux2, true);
     // add 40 documents in compound files
     addDocs2(writer, 50);
-    assertEquals(50, writer.docCount());
+    assertEquals(50, writer.maxDoc());
     writer.close();
 
     // test doc count before segments are merged
     writer = newWriter(dir, false);
-    assertEquals(100, writer.docCount());
+    assertEquals(100, writer.maxDoc());
     writer.addIndexesNoOptimize(new Directory[] { aux, aux2 });
-    assertEquals(190, writer.docCount());
+    assertEquals(190, writer.maxDoc());
     writer.close();
 
     // make sure the old index is correct
@@ -77,14 +77,14 @@
     writer = newWriter(aux3, true);
     // add 40 documents
     addDocs(writer, 40);
-    assertEquals(40, writer.docCount());
+    assertEquals(40, writer.maxDoc());
     writer.close();
 
     // test doc count before segments are merged/index is optimized
     writer = newWriter(dir, false);
-    assertEquals(190, writer.docCount());
+    assertEquals(190, writer.maxDoc());
     writer.addIndexesNoOptimize(new Directory[] { aux3 });
-    assertEquals(230, writer.docCount());
+    assertEquals(230, writer.maxDoc());
     writer.close();
 
     // make sure the new index is correct
@@ -113,9 +113,9 @@
     writer.close();
 
     writer = newWriter(dir, false);
-    assertEquals(230, writer.docCount());
+    assertEquals(230, writer.maxDoc());
     writer.addIndexesNoOptimize(new Directory[] { aux4 });
-    assertEquals(231, writer.docCount());
+    assertEquals(231, writer.maxDoc());
     writer.close();
 
     verifyNumDocs(dir, 231);
@@ -250,7 +250,7 @@
     writer = newWriter(dir, true);
     // add 100 documents
     addDocs(writer, 100);
-    assertEquals(100, writer.docCount());
+    assertEquals(100, writer.maxDoc());
     writer.close();
 
     writer = newWriter(aux, true);
@@ -272,7 +272,7 @@
       assertTrue(false);
     }
     catch (IllegalArgumentException e) {
-      assertEquals(100, writer.docCount());
+      assertEquals(100, writer.maxDoc());
     }
     writer.close();
 
@@ -297,7 +297,7 @@
     addDocs(writer, 10);
 
     writer.addIndexesNoOptimize(new Directory[] { aux });
-    assertEquals(1040, writer.docCount());
+    assertEquals(1040, writer.maxDoc());
     assertEquals(2, writer.getSegmentCount());
     assertEquals(1000, writer.getDocCount(0));
     writer.close();
@@ -321,7 +321,7 @@
     addDocs(writer, 2);
 
     writer.addIndexesNoOptimize(new Directory[] { aux });
-    assertEquals(1032, writer.docCount());
+    assertEquals(1032, writer.maxDoc());
     assertEquals(2, writer.getSegmentCount());
     assertEquals(1000, writer.getDocCount(0));
     writer.close();
@@ -344,7 +344,7 @@
     writer.setMergeFactor(4);
 
     writer.addIndexesNoOptimize(new Directory[] { aux, new RAMDirectory(aux) });
-    assertEquals(1060, writer.docCount());
+    assertEquals(1060, writer.maxDoc());
     assertEquals(1000, writer.getDocCount(0));
     writer.close();
 
@@ -373,7 +373,7 @@
     writer.setMergeFactor(4);
 
     writer.addIndexesNoOptimize(new Directory[] { aux, new RAMDirectory(aux) });
-    assertEquals(1020, writer.docCount());
+    assertEquals(1020, writer.maxDoc());
     assertEquals(1000, writer.getDocCount(0));
     writer.close();
 
@@ -395,7 +395,7 @@
     writer.setMaxBufferedDocs(100);
     writer.setMergeFactor(10);
     writer.addIndexesNoOptimize(new Directory[] { aux });
-    assertEquals(30, writer.docCount());
+    assertEquals(30, writer.maxDoc());
     assertEquals(3, writer.getSegmentCount());
     writer.close();
 
@@ -418,7 +418,7 @@
     writer.setMergeFactor(4);
 
     writer.addIndexesNoOptimize(new Directory[] { aux, aux2 });
-    assertEquals(1025, writer.docCount());
+    assertEquals(1025, writer.maxDoc());
     assertEquals(1000, writer.getDocCount(0));
     writer.close();
 
@@ -476,7 +476,7 @@
     writer.setMaxBufferedDocs(1000);
     // add 1000 documents in 1 segment
     addDocs(writer, 1000);
-    assertEquals(1000, writer.docCount());
+    assertEquals(1000, writer.maxDoc());
     assertEquals(1, writer.getSegmentCount());
     writer.close();
 
@@ -493,7 +493,7 @@
       writer.setMaxBufferedDocs(100);
       writer.setMergeFactor(10);
     }
-    assertEquals(30, writer.docCount());
+    assertEquals(30, writer.maxDoc());
     assertEquals(3, writer.getSegmentCount());
     writer.close();
   }

Propchange: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 15 19:55:36 2009
@@ -1 +1,2 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:748824
+/lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:824919-825624

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java Thu Oct 15 19:55:36 2009
@@ -87,7 +87,7 @@
         writer.addDocument(doc);
         failure.setDoFail();
         try {
-          writer.flush();
+          writer.flush(true, false, true);
           if (failure.hitExc) {
             fail("failed to hit IOException");
           }
@@ -139,7 +139,7 @@
         delID += 10;
       }
 
-      writer.flush();
+      writer.commit();
     }
 
     writer.close();
@@ -209,7 +209,7 @@
       // stress out aborting them on close:
       writer.setMergeFactor(3);
       writer.addDocument(doc);
-      writer.flush();
+      writer.commit();
 
       writer.close(false);
 

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestCrash.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestCrash.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestCrash.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestCrash.java Thu Oct 15 19:55:36 2009
@@ -82,7 +82,7 @@
     MockRAMDirectory dir = (MockRAMDirectory) writer.getDirectory();
     writer.close();
     writer = initIndex(dir);
-    assertEquals(314, writer.docCount());
+    assertEquals(314, writer.maxDoc());
     crash(writer);
 
     /*

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDoc.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDoc.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDoc.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDoc.java Thu Oct 15 19:55:36 2009
@@ -172,15 +172,15 @@
       Document doc = new Document();
       doc.add(new Field("contents", new FileReader(file)));
       writer.addDocument(doc);
-      writer.flush();
+      writer.commit();
       return writer.newestSegment();
    }
 
 
    private SegmentInfo merge(SegmentInfo si1, SegmentInfo si2, String merged, boolean useCompoundFile)
    throws Exception {
-      SegmentReader r1 = SegmentReader.get(si1);
-      SegmentReader r2 = SegmentReader.get(si2);
+      SegmentReader r1 = SegmentReader.get(true, si1, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
+      SegmentReader r2 = SegmentReader.get(true, si2, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
 
       SegmentMerger merger = new SegmentMerger(si1.dir, merged);
 
@@ -201,7 +201,7 @@
 
    private void printSegment(PrintWriter out, SegmentInfo si)
    throws Exception {
-      SegmentReader reader = SegmentReader.get(si);
+      SegmentReader reader = SegmentReader.get(true, si, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
 
       for (int i = 0; i < reader.numDocs(); i++)
         out.println(reader.document(i));

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDocumentWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDocumentWriter.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDocumentWriter.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDocumentWriter.java Thu Oct 15 19:55:36 2009
@@ -63,11 +63,11 @@
     Analyzer analyzer = new WhitespaceAnalyzer();
     IndexWriter writer = new IndexWriter(dir, analyzer, true, IndexWriter.MaxFieldLength.LIMITED);
     writer.addDocument(testDoc);
-    writer.flush();
+    writer.commit();
     SegmentInfo info = writer.newestSegment();
     writer.close();
     //After adding the document, we should be able to read it back in
-    SegmentReader reader = SegmentReader.get(info);
+    SegmentReader reader = SegmentReader.get(true, info, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
     assertTrue(reader != null);
     Document doc = reader.document(0);
     assertTrue(doc != null);
@@ -123,10 +123,10 @@
     doc.add(new Field("repeated", "repeated two", Field.Store.YES, Field.Index.ANALYZED));
 
     writer.addDocument(doc);
-    writer.flush();
+    writer.commit();
     SegmentInfo info = writer.newestSegment();
     writer.close();
-    SegmentReader reader = SegmentReader.get(info);
+    SegmentReader reader = SegmentReader.get(true, info, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
 
     TermPositions termPositions = reader.termPositions(new Term("repeated", "repeated"));
     assertTrue(termPositions.next());
@@ -183,10 +183,10 @@
     doc.add(new Field("f1", "a 5 a a", Field.Store.YES, Field.Index.ANALYZED));
 
     writer.addDocument(doc);
-    writer.flush();
+    writer.commit();
     SegmentInfo info = writer.newestSegment();
     writer.close();
-    SegmentReader reader = SegmentReader.get(info);
+    SegmentReader reader = SegmentReader.get(true, info, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
 
     TermPositions termPositions = reader.termPositions(new Term("f1", "a"));
     assertTrue(termPositions.next());
@@ -223,10 +223,10 @@
     }, TermVector.NO));
     
     writer.addDocument(doc);
-    writer.flush();
+    writer.commit();
     SegmentInfo info = writer.newestSegment();
     writer.close();
-    SegmentReader reader = SegmentReader.get(info);
+    SegmentReader reader = SegmentReader.get(true, info, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
 
     TermPositions termPositions = reader.termPositions(new Term("preanalyzed", "term1"));
     assertTrue(termPositions.next());

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReader.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReader.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReader.java Thu Oct 15 19:55:36 2009
@@ -1739,7 +1739,7 @@
       // expected
     }
 
-    assertEquals(-1, r.getTermInfosIndexDivisor());
+    assertEquals(-1, ((SegmentReader) r.getSequentialSubReaders()[0]).getTermInfosIndexDivisor());
     writer = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
     writer.addDocument(doc);
     writer.close();

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java Thu Oct 15 19:55:36 2009
@@ -119,7 +119,8 @@
         IndexWriter.MaxFieldLength.LIMITED);
     iw.setMaxBufferedDocs(5);
     iw.setMergeFactor(3);
-    iw.addIndexes(new Directory[] { dir1, dir2 });
+    iw.addIndexesNoOptimize(new Directory[] { dir1, dir2 });
+    iw.optimize();
     iw.close();
 
     norms1.addAll(norms);

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderReopen.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderReopen.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderReopen.java Thu Oct 15 19:55:36 2009
@@ -935,7 +935,7 @@
     for (int i = 0; i < 100; i++) {
       w.addDocument(createDocument(i, 4));
       if (multiSegment && (i % 10) == 0) {
-        w.flush();
+        w.commit();
       }
     }
     

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java Thu Oct 15 19:55:36 2009
@@ -101,7 +101,7 @@
         for (i = 0; i < 100; i++) {
             addDoc(writer);
         }
-        assertEquals(100, writer.docCount());
+        assertEquals(100, writer.maxDoc());
         writer.close();
 
         // delete 40 documents
@@ -113,7 +113,7 @@
 
         // test doc count before segments are merged/index is optimized
         writer = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.LIMITED);
-        assertEquals(100, writer.docCount());
+        assertEquals(100, writer.maxDoc());
         writer.close();
 
         reader = IndexReader.open(dir, true);
@@ -161,7 +161,7 @@
 
     /*
       Test: make sure when we run out of disk space or hit
-      random IOExceptions in any of the addIndexes(*) calls
+      random IOExceptions in any of the addIndexesNoOptimize(*) calls
       that 1) index is not corrupt (searcher can open/search
       it) and 2) transactional semantics are followed:
       either all or none of the incoming documents were in
@@ -176,7 +176,7 @@
       boolean debug = false;
 
       // Build up a bunch of dirs that have indexes which we
-      // will then merge together by calling addIndexes(*):
+      // will then merge together by calling addIndexesNoOptimize(*):
       Directory[] dirs = new Directory[NUM_DIR];
       long inputDiskUsage = 0;
       for(int i=0;i<NUM_DIR;i++) {
@@ -193,7 +193,7 @@
       }
 
       // Now, build a starting index that has START_COUNT docs.  We
-      // will then try to addIndexes into a copy of this:
+      // will then try to addIndexesNoOptimize into a copy of this:
       RAMDirectory startDir = new RAMDirectory();
       IndexWriter writer = new IndexWriter(startDir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
       for(int j=0;j<START_COUNT;j++) {
@@ -214,12 +214,12 @@
 
       // Iterate with larger and larger amounts of free
       // disk space.  With little free disk space,
-      // addIndexes will certainly run out of space &
+      // addIndexesNoOptimize will certainly run out of space &
       // fail.  Verify that when this happens, index is
       // not corrupt and index in fact has added no
       // documents.  Then, we increase disk space by 2000
       // bytes each iteration.  At some point there is
-      // enough free disk space and addIndexes should
+      // enough free disk space and addIndexesNoOptimize should
       // succeed and index should show all documents were
       // added.
 
@@ -247,7 +247,7 @@
 
         String methodName;
         if (0 == method) {
-          methodName = "addIndexes(Directory[])";
+          methodName = "addIndexes(Directory[]) + optimize()";
         } else if (1 == method) {
           methodName = "addIndexes(IndexReader[])";
         } else {
@@ -311,7 +311,8 @@
             try {
 
               if (0 == method) {
-                writer.addIndexes(dirs);
+                writer.addIndexesNoOptimize(dirs);
+                writer.optimize();
               } else if (1 == method) {
                 IndexReader readers[] = new IndexReader[dirs.length];
                 for(int i=0;i<dirs.length;i++) {
@@ -493,7 +494,7 @@
 
           if (hitError) {
             if (doAbort) {
-              writer.abort();
+              writer.rollback();
             } else {
               try {
                 writer.close();
@@ -749,7 +750,7 @@
 
           // now open index for create:
           writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-          assertEquals("should be zero documents", writer.docCount(), 0);
+          assertEquals("should be zero documents", writer.maxDoc(), 0);
           addDoc(writer);
           writer.close();
 
@@ -1011,9 +1012,9 @@
       searcher.close();
 
       // Now, close the writer:
-      writer.abort();
+      writer.rollback();
 
-      assertNoUnreferencedFiles(dir, "unreferenced files remain after abort()");
+      assertNoUnreferencedFiles(dir, "unreferenced files remain after rollback()");
 
       searcher = new IndexSearcher(dir, false);
       hits = searcher.search(new TermQuery(searchTerm), null, 1000).scoreDocs;
@@ -1095,7 +1096,7 @@
 
     /*
      * Verify that calling optimize when writer is open for
-     * "commit on close" works correctly both for abort()
+     * "commit on close" works correctly both for rollback()
      * and close().
      */
     public void testCommitOnCloseOptimize() throws IOException {
@@ -1119,7 +1120,7 @@
       reader.close();
 
       // Abort the writer:
-      writer.abort();
+      writer.rollback();
       assertNoUnreferencedFiles(dir, "aborted writer after optimize");
 
       // Open a reader after aborting writer:
@@ -1145,7 +1146,7 @@
     public void testIndexNoDocuments() throws IOException {
       RAMDirectory dir = new RAMDirectory();      
       IndexWriter writer  = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-      writer.flush();
+      writer.commit();
       writer.close();
 
       IndexReader reader = IndexReader.open(dir, true);
@@ -1154,7 +1155,7 @@
       reader.close();
 
       writer  = new IndexWriter(dir, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
-      writer.flush();
+      writer.commit();
       writer.close();
 
       reader = IndexReader.open(dir, true);
@@ -1515,7 +1516,7 @@
       Document doc = new Document();
       doc.add(new Field("field", "aaa", Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS));
       writer.addDocument(doc);
-      writer.flush();
+      writer.commit();
       writer.addDocument(new Document());
       writer.close();
       _TestUtil.checkIndex(dir);
@@ -1607,13 +1608,13 @@
                            Field.TermVector.NO));
     iw.addDocument(document);
     // Make first segment
-    iw.flush();
+    iw.commit();
 
     document.add(new Field("tvtest", "a b c", Field.Store.NO, Field.Index.ANALYZED,
         Field.TermVector.YES));
     iw.addDocument(document);
     // Make 2nd segment
-    iw.flush();
+    iw.commit();
 
     iw.optimize();
     iw.close();
@@ -1628,14 +1629,14 @@
     document.add(new Field("tvtest", "a b c", Field.Store.NO, Field.Index.ANALYZED,
         Field.TermVector.YES));
     iw.addDocument(document);
-    iw.flush();
+    iw.commit();
 
     document = new Document();
     document.add(new Field("tvtest", "x y z", Field.Store.NO, Field.Index.ANALYZED,
                            Field.TermVector.NO));
     iw.addDocument(document);
     // Make first segment
-    iw.flush();
+    iw.commit();
 
     iw.optimize();
 
@@ -1643,7 +1644,7 @@
         Field.TermVector.YES));
     iw.addDocument(document);
     // Make 2nd segment
-    iw.flush();
+    iw.commit();
     iw.optimize();
 
     iw.close();
@@ -2484,25 +2485,25 @@
   }
 
   // LUCENE-1130: make sure initial IOException, and then 2nd
-  // IOException during abort(), is OK:
+  // IOException during rollback(), is OK:
   public void testIOExceptionDuringAbort() throws IOException {
     _testSingleThreadFailure(new FailOnlyOnAbortOrFlush(false));
   }
 
   // LUCENE-1130: make sure initial IOException, and then 2nd
-  // IOException during abort(), is OK:
+  // IOException during rollback(), is OK:
   public void testIOExceptionDuringAbortOnlyOnce() throws IOException {
     _testSingleThreadFailure(new FailOnlyOnAbortOrFlush(true));
   }
 
   // LUCENE-1130: make sure initial IOException, and then 2nd
-  // IOException during abort(), with multiple threads, is OK:
+  // IOException during rollback(), with multiple threads, is OK:
   public void testIOExceptionDuringAbortWithThreads() throws Exception {
     _testMultipleThreadsFailure(new FailOnlyOnAbortOrFlush(false));
   }
 
   // LUCENE-1130: make sure initial IOException, and then 2nd
-  // IOException during abort(), with multiple threads, is OK:
+  // IOException during rollback(), with multiple threads, is OK:
   public void testIOExceptionDuringAbortWithThreadsOnlyOnce() throws Exception {
     _testMultipleThreadsFailure(new FailOnlyOnAbortOrFlush(true));
   }
@@ -2782,7 +2783,8 @@
       writer.setMergePolicy(new LogDocMergePolicy(writer));
 
       Directory[] indexDirs = {new MockRAMDirectory(dir)};
-      writer.addIndexes(indexDirs);
+      writer.addIndexesNoOptimize(indexDirs);
+      writer.optimize();
       writer.close();
     }
     dir.close();
@@ -3235,7 +3237,7 @@
       // Expected
     }
     assertTrue(failure.fail1 && failure.fail2);
-    w.abort();
+    w.rollback();
     dir.close();
   }
   
@@ -3724,7 +3726,8 @@
     void doBody(int j, Directory[] dirs) throws Throwable {
       switch(j%4) {
       case 0:
-        writer2.addIndexes(dirs);
+        writer2.addIndexesNoOptimize(dirs);
+        writer2.optimize();
         break;
       case 1:
         writer2.addIndexesNoOptimize(dirs);
@@ -3810,7 +3813,8 @@
     void doBody(int j, Directory[] dirs) throws Throwable {
       switch(j%5) {
       case 0:
-        writer2.addIndexes(dirs);
+        writer2.addIndexesNoOptimize(dirs);
+        writer2.optimize();
         break;
       case 1:
         writer2.addIndexesNoOptimize(dirs);

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterDelete.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterDelete.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterDelete.java Thu Oct 15 19:55:36 2009
@@ -153,7 +153,7 @@
 
       addDoc(modifier, ++id, value);
       assertEquals(0, modifier.getSegmentCount());
-      modifier.flush();
+      modifier.commit();
 
       modifier.commit();
 

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java Thu Oct 15 19:55:36 2009
@@ -198,7 +198,7 @@
     ((ConcurrentMergeScheduler) writer.getMergeScheduler()).sync();
     writer.commit();
     checkInvariants(writer);
-    assertEquals(10, writer.docCount());
+    assertEquals(10, writer.maxDoc());
 
     writer.close();
   }

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMerging.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMerging.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMerging.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMerging.java Thu Oct 15 19:55:36 2009
@@ -29,7 +29,7 @@
 {
 
   /**
-   * Tests that index merging (specifically addIndexes()) doesn't
+   * Tests that index merging (specifically addIndexesNoOptimize()) doesn't
    * change the index order of documents.
    */
   public void testLucene() throws IOException
@@ -59,7 +59,8 @@
     IndexWriter writer = new IndexWriter(merged, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
     writer.setMergeFactor(2);
 
-    writer.addIndexes(new Directory[]{indexA, indexB});
+    writer.addIndexesNoOptimize(new Directory[]{indexA, indexB});
+    writer.optimize();
     writer.close();
 
     fail = verifyIndex(merged, 0);

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java Thu Oct 15 19:55:36 2009
@@ -428,7 +428,8 @@
     void doBody(int j, Directory[] dirs) throws Throwable {
       switch (j % 4) {
         case 0:
-          mainWriter.addIndexes(dirs);
+          mainWriter.addIndexesNoOptimize(dirs);
+          mainWriter.optimize();
           break;
         case 1:
           mainWriter.addIndexesNoOptimize(dirs);

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java Thu Oct 15 19:55:36 2009
@@ -63,7 +63,7 @@
       d1.add(new Field(term.field(), term.text(), Store.NO, Index.ANALYZED));
       writer.addDocument(d1);
     }
-    writer.flush();
+    writer.commit();
     writer.optimize();
     writer.close();
 

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestMultiReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestMultiReader.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestMultiReader.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestMultiReader.java Thu Oct 15 19:55:36 2009
@@ -28,8 +28,8 @@
     IndexReader reader;
 
     sis.read(dir);
-    SegmentReader reader1 = SegmentReader.get(sis.info(0));
-    SegmentReader reader2 = SegmentReader.get(sis.info(1));
+    SegmentReader reader1 = SegmentReader.get(false, sis.info(0), IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
+    SegmentReader reader2 = SegmentReader.get(false, sis.info(1), IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
     readers[0] = reader1;
     readers[1] = reader2;
     assertTrue(reader1 != null);

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestNorms.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestNorms.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestNorms.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestNorms.java Thu Oct 15 19:55:36 2009
@@ -36,7 +36,7 @@
 
 /**
  * Test that norms info is preserved during index life - including
- * separate norms, addDocument, addIndexes, optimize.
+ * separate norms, addDocument, addIndexesNoOptimize, optimize.
  */
 public class TestNorms extends LuceneTestCase {
 
@@ -112,7 +112,8 @@
     IndexWriter iw = new IndexWriter(dir3,anlzr,false, IndexWriter.MaxFieldLength.LIMITED);
     iw.setMaxBufferedDocs(5);
     iw.setMergeFactor(3);
-    iw.addIndexes(new Directory[]{dir1,dir2});
+    iw.addIndexesNoOptimize(new Directory[]{dir1,dir2});
+    iw.optimize();
     iw.close();
     
     norms1.addAll(norms);

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestPayloads.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestPayloads.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestPayloads.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestPayloads.java Thu Oct 15 19:55:36 2009
@@ -202,7 +202,7 @@
         }
         
         // make sure we create more than one segment to test merging
-        writer.flush();
+        writer.commit();
         
         // now we make sure to have different payload lengths next at the next skip point        
         for (int i = 0; i < numDocs; i++) {

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestSegmentMerger.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestSegmentMerger.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestSegmentMerger.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestSegmentMerger.java Thu Oct 15 19:55:36 2009
@@ -49,8 +49,8 @@
     SegmentInfo info1 = DocHelper.writeDoc(merge1Dir, doc1);
     DocHelper.setupDoc(doc2);
     SegmentInfo info2 = DocHelper.writeDoc(merge2Dir, doc2);
-    reader1 = SegmentReader.get(info1);
-    reader2 = SegmentReader.get(info2);
+    reader1 = SegmentReader.get(true, info1, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
+    reader2 = SegmentReader.get(true, info2, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
   }
 
   public void test() {
@@ -69,7 +69,7 @@
     merger.closeReaders();
     assertTrue(docsMerged == 2);
     //Should be able to open a new SegmentReader against the new directory
-    SegmentReader mergedReader = SegmentReader.get(new SegmentInfo(mergedSegment, docsMerged, mergedDir, false, true));
+    SegmentReader mergedReader = SegmentReader.get(true, new SegmentInfo(mergedSegment, docsMerged, mergedDir, false, true), IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
     assertTrue(mergedReader != null);
     assertTrue(mergedReader.numDocs() == 2);
     Document newDoc1 = mergedReader.document(0);

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestSegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestSegmentReader.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestSegmentReader.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestSegmentReader.java Thu Oct 15 19:55:36 2009
@@ -43,7 +43,7 @@
     super.setUp();
     DocHelper.setupDoc(testDoc);
     SegmentInfo info = DocHelper.writeDoc(dir, testDoc);
-    reader = SegmentReader.get(info);
+    reader = SegmentReader.get(true, info, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
   }
 
   public void test() {
@@ -73,7 +73,7 @@
     Document docToDelete = new Document();
     DocHelper.setupDoc(docToDelete);
     SegmentInfo info = DocHelper.writeDoc(dir, docToDelete);
-    SegmentReader deleteReader = SegmentReader.get(info);
+    SegmentReader deleteReader = SegmentReader.get(false, info, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
     assertTrue(deleteReader != null);
     assertTrue(deleteReader.numDocs() == 1);
     deleteReader.deleteDocument(0);
@@ -168,14 +168,7 @@
           // test for fake norms of 1.0 or null depending on the flag
           byte [] norms = reader.norms(f.name());
           byte norm1 = DefaultSimilarity.encodeNorm(1.0f);
-          if (reader.getDisableFakeNorms())
-            assertNull(norms);
-          else {
-            assertEquals(norms.length,reader.maxDoc());
-            for (int j=0; j<reader.maxDoc(); j++) {
-              assertEquals(norms[j], norm1);
-            }
-          }
+          assertNull(norms);
           norms = new byte[reader.maxDoc()];
           reader.norms(f.name(),norms, 0);
           for (int j=0; j<reader.maxDoc(); j++) {

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestTermVectorsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestTermVectorsReader.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestTermVectorsReader.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestTermVectorsReader.java Thu Oct 15 19:55:36 2009
@@ -111,7 +111,7 @@
     //terms
     for(int j=0;j<5;j++)
       writer.addDocument(doc);
-    writer.flush();
+    writer.commit();
     seg = writer.newestSegment().name;
     writer.close();
 

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestThreadedOptimize.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestThreadedOptimize.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestThreadedOptimize.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestThreadedOptimize.java Thu Oct 15 19:55:36 2009
@@ -73,8 +73,6 @@
       writer.setMergeFactor(4);
       //writer.setInfoStream(System.out);
 
-      final int docCount = writer.docCount();
-
       Thread[] threads = new Thread[NUM_THREADS];
       
       for(int i=0;i<NUM_THREADS;i++) {
@@ -116,7 +114,7 @@
 
       // System.out.println("TEST: now index=" + writer.segString());
 
-      assertEquals(expectedDocCount, writer.docCount());
+      assertEquals(expectedDocCount, writer.maxDoc());
 
       writer.close();
       writer = new IndexWriter(directory, ANALYZER, false, IndexWriter.MaxFieldLength.UNLIMITED);

Propchange: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/queryParser/TestQueryParser.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 15 19:55:36 2009
@@ -1,2 +1,3 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/queryParser/TestQueryParser.java:748824
+/lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/queryParser/TestQueryParser.java:824919-825624
 /lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java:821379,821431

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/search/TestPositionIncrement.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/search/TestPositionIncrement.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/search/TestPositionIncrement.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/search/TestPositionIncrement.java Thu Oct 15 19:55:36 2009
@@ -231,96 +231,83 @@
   }
   
   public void testPayloadsPos0() throws Exception {
-    for(int x=0;x<2;x++) {
-      Directory dir = new MockRAMDirectory();
-      IndexWriter writer = new IndexWriter(dir,
-                                           new TestPayloadAnalyzer(), true,
-                                           IndexWriter.MaxFieldLength.LIMITED);
-      if (x == 1) {
-        writer.setAllowMinus1Position();
-      }
-      Document doc = new Document();
-      doc.add(new Field("content",
-                        new StringReader("a a b c d e a f g h i j a b k k")));
-      writer.addDocument(doc);
-
-      IndexReader r = writer.getReader();
-
-      TermPositions tp = r.termPositions(new Term("content", "a"));
-      int count = 0;
-      assertTrue(tp.next());
-      // "a" occurs 4 times
-      assertEquals(4, tp.freq());
-      int expected;
-      if (x == 1) {
-        expected = Integer.MAX_VALUE;
-      } else {
-        expected = 0;
-      }
-      assertEquals(expected, tp.nextPosition());
-      if (x == 1) {
-        continue;
-      }
-      assertEquals(1, tp.nextPosition());
-      assertEquals(3, tp.nextPosition());
-      assertEquals(6, tp.nextPosition());
-
-      // only one doc has "a"
-      assertFalse(tp.next());
-
-      IndexSearcher is = new IndexSearcher(r);
-    
-      SpanTermQuery stq1 = new SpanTermQuery(new Term("content", "a"));
-      SpanTermQuery stq2 = new SpanTermQuery(new Term("content", "k"));
-      SpanQuery[] sqs = { stq1, stq2 };
-      SpanNearQuery snq = new SpanNearQuery(sqs, 30, false);
-
-      count = 0;
-      boolean sawZero = false;
-      //System.out.println("\ngetPayloadSpans test");
-      Spans pspans = snq.getSpans(is.getIndexReader());
-      while (pspans.next()) {
-        //System.out.println(pspans.doc() + " - " + pspans.start() + " - "+ pspans.end());
-        Collection payloads = pspans.getPayload();
-        sawZero |= pspans.start() == 0;
-        for (Iterator it = payloads.iterator(); it.hasNext();) {
-          count++;
-          it.next();
-          //System.out.println(new String((byte[]) it.next()));
-        }
-      }
-      assertEquals(5, count);
-      assertTrue(sawZero);
+    Directory dir = new MockRAMDirectory();
+    IndexWriter writer = new IndexWriter(dir,
+                                         new TestPayloadAnalyzer(), true,
+                                         IndexWriter.MaxFieldLength.LIMITED);
+    Document doc = new Document();
+    doc.add(new Field("content",
+                      new StringReader("a a b c d e a f g h i j a b k k")));
+    writer.addDocument(doc);
+
+    IndexReader r = writer.getReader();
+
+    TermPositions tp = r.termPositions(new Term("content", "a"));
+    int count = 0;
+    assertTrue(tp.next());
+    // "a" occurs 4 times
+    assertEquals(4, tp.freq());
+    int expected = 0;
+    assertEquals(expected, tp.nextPosition());
+    assertEquals(1, tp.nextPosition());
+    assertEquals(3, tp.nextPosition());
+    assertEquals(6, tp.nextPosition());
+
+    // only one doc has "a"
+    assertFalse(tp.next());
 
-      //System.out.println("\ngetSpans test");
-      Spans spans = snq.getSpans(is.getIndexReader());
-      count = 0;
-      sawZero = false;
-      while (spans.next()) {
+    IndexSearcher is = new IndexSearcher(r);
+  
+    SpanTermQuery stq1 = new SpanTermQuery(new Term("content", "a"));
+    SpanTermQuery stq2 = new SpanTermQuery(new Term("content", "k"));
+    SpanQuery[] sqs = { stq1, stq2 };
+    SpanNearQuery snq = new SpanNearQuery(sqs, 30, false);
+
+    count = 0;
+    boolean sawZero = false;
+    //System.out.println("\ngetPayloadSpans test");
+    Spans pspans = snq.getSpans(is.getIndexReader());
+    while (pspans.next()) {
+      //System.out.println(pspans.doc() + " - " + pspans.start() + " - "+ pspans.end());
+      Collection payloads = pspans.getPayload();
+      sawZero |= pspans.start() == 0;
+      for (Iterator it = payloads.iterator(); it.hasNext();) {
         count++;
-        sawZero |= spans.start() == 0;
-        //System.out.println(spans.doc() + " - " + spans.start() + " - " + spans.end());
+        it.next();
+        //System.out.println(new String((byte[]) it.next()));
       }
-      assertEquals(4, count);
-      assertTrue(sawZero);
-		
-      //System.out.println("\nPayloadSpanUtil test");
-
-      sawZero = false;
-      PayloadSpanUtil psu = new PayloadSpanUtil(is.getIndexReader());
-      Collection pls = psu.getPayloadsForQuery(snq);
-      count = pls.size();
-      for (Iterator it = pls.iterator(); it.hasNext();) {
-        String s = new String((byte[]) it.next());
-        //System.out.println(s);
-        sawZero |= s.equals("pos: 0");
-      }
-      assertEquals(5, count);
-      assertTrue(sawZero);
-      writer.close();
-      is.getIndexReader().close();
-      dir.close();
     }
+    assertEquals(5, count);
+    assertTrue(sawZero);
+
+    //System.out.println("\ngetSpans test");
+    Spans spans = snq.getSpans(is.getIndexReader());
+    count = 0;
+    sawZero = false;
+    while (spans.next()) {
+      count++;
+      sawZero |= spans.start() == 0;
+      //System.out.println(spans.doc() + " - " + spans.start() + " - " + spans.end());
+    }
+    assertEquals(4, count);
+    assertTrue(sawZero);
+  
+    //System.out.println("\nPayloadSpanUtil test");
+
+    sawZero = false;
+    PayloadSpanUtil psu = new PayloadSpanUtil(is.getIndexReader());
+    Collection pls = psu.getPayloadsForQuery(snq);
+    count = pls.size();
+    for (Iterator it = pls.iterator(); it.hasNext();) {
+      String s = new String((byte[]) it.next());
+      //System.out.println(s);
+      sawZero |= s.equals("pos: 0");
+    }
+    assertEquals(5, count);
+    assertTrue(sawZero);
+    writer.close();
+    is.getIndexReader().close();
+    dir.close();
   }
 }
 

Modified: lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/store/TestRAMDirectory.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/store/TestRAMDirectory.java?rev=825626&r1=825625&r2=825626&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/store/TestRAMDirectory.java (original)
+++ lucene/java/branches/flex_1458_2_9_back_compat_tests/src/test/org/apache/lucene/store/TestRAMDirectory.java Thu Oct 15 19:55:36 2009
@@ -65,7 +65,7 @@
       doc.add(new Field("content", English.intToEnglish(i).trim(), Field.Store.YES, Field.Index.NOT_ANALYZED));
       writer.addDocument(doc);
     }
-    assertEquals(docsToAdd, writer.docCount());
+    assertEquals(docsToAdd, writer.maxDoc());
     writer.close();
     dir.close();
   }



Mime
View raw message