lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1634823 [6/9] - in /lucene/dev/branches/lucene6005: ./ dev-tools/ lucene/ lucene/analysis/ lucene/analysis/common/ lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/ lucene/analysis/common/src/java/org/apache/lucene/analy...
Date Tue, 28 Oct 2014 09:19:29 GMT
Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestSizeBoundedForceMerge.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestSizeBoundedForceMerge.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestSizeBoundedForceMerge.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestSizeBoundedForceMerge.java Tue Oct 28 09:19:21 2014
@@ -66,8 +66,7 @@ public class TestSizeBoundedForceMerge e
     }
     writer.close();
 
-    SegmentInfos sis = new SegmentInfos();
-    sis.read(dir);
+    SegmentInfos sis = SegmentInfos.readLatestCommit(dir);
     double min = sis.info(0).sizeInBytes();
 
     conf = newWriterConfig();
@@ -80,8 +79,7 @@ public class TestSizeBoundedForceMerge e
     writer.close();
 
     // Should only be 3 segments in the index, because one of them exceeds the size limit
-    sis = new SegmentInfos();
-    sis.read(dir);
+    sis = SegmentInfos.readLatestCommit(dir);
     assertEquals(3, sis.size());
   }
 
@@ -113,8 +111,7 @@ public class TestSizeBoundedForceMerge e
     writer.close();
 
     // Should only be 3 segments in the index, because one of them exceeds the size limit
-    SegmentInfos sis = new SegmentInfos();
-    sis.read(dir);
+    SegmentInfos sis = SegmentInfos.readLatestCommit(dir);
     assertEquals(3, sis.size());
   }
 
@@ -140,8 +137,7 @@ public class TestSizeBoundedForceMerge e
     writer.forceMerge(1);
     writer.close();
 
-    SegmentInfos sis = new SegmentInfos();
-    sis.read(dir);
+    SegmentInfos sis = SegmentInfos.readLatestCommit(dir);
     assertEquals(2, sis.size());
   }
   
@@ -167,8 +163,7 @@ public class TestSizeBoundedForceMerge e
     writer.forceMerge(1);
     writer.close();
     
-    SegmentInfos sis = new SegmentInfos();
-    sis.read(dir);
+    SegmentInfos sis = SegmentInfos.readLatestCommit(dir);
     assertEquals(2, sis.size());
   }
   
@@ -194,8 +189,7 @@ public class TestSizeBoundedForceMerge e
     writer.forceMerge(1);
     writer.close();
     
-    SegmentInfos sis = new SegmentInfos();
-    sis.read(dir);
+    SegmentInfos sis = SegmentInfos.readLatestCommit(dir);
     assertEquals(1, sis.size());
   }
   
@@ -220,8 +214,7 @@ public class TestSizeBoundedForceMerge e
     writer.forceMerge(1);
     writer.close();
     
-    SegmentInfos sis = new SegmentInfos();
-    sis.read(dir);
+    SegmentInfos sis = SegmentInfos.readLatestCommit(dir);
     assertEquals(3, sis.size());
   }
   
@@ -247,8 +240,7 @@ public class TestSizeBoundedForceMerge e
     writer.forceMerge(1);
     writer.close();
     
-    SegmentInfos sis = new SegmentInfos();
-    sis.read(dir);
+    SegmentInfos sis = SegmentInfos.readLatestCommit(dir);
     assertEquals(4, sis.size());
   }
   
@@ -280,8 +272,7 @@ public class TestSizeBoundedForceMerge e
     
     // Should only be 4 segments in the index, because of the merge factor and
     // max merge docs settings.
-    SegmentInfos sis = new SegmentInfos();
-    sis.read(dir);
+    SegmentInfos sis = SegmentInfos.readLatestCommit(dir);
     assertEquals(4, sis.size());
   }
   
@@ -309,8 +300,7 @@ public class TestSizeBoundedForceMerge e
     writer.close();
     
     // Verify that the last segment does not have deletions.
-    SegmentInfos sis = new SegmentInfos();
-    sis.read(dir);
+    SegmentInfos sis = SegmentInfos.readLatestCommit(dir);
     assertEquals(3, sis.size());
     assertFalse(sis.info(2).hasDeletions());
   }
@@ -335,8 +325,7 @@ public class TestSizeBoundedForceMerge e
     writer.close();
     
     // Verify that the last segment does not have deletions.
-    SegmentInfos sis = new SegmentInfos();
-    sis.read(dir);
+    SegmentInfos sis = SegmentInfos.readLatestCommit(dir);
     assertEquals(1, sis.size());
   }
 
@@ -363,8 +352,7 @@ public class TestSizeBoundedForceMerge e
     writer.close();
     
     // Verify that the last segment does not have deletions.
-    SegmentInfos sis = new SegmentInfos();
-    sis.read(dir);
+    SegmentInfos sis = SegmentInfos.readLatestCommit(dir);
     assertEquals(1, sis.size());
     assertTrue(sis.info(0).hasDeletions());
   }

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/MockFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/MockFilter.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/MockFilter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/MockFilter.java Tue Oct 28 09:19:21 2014
@@ -18,6 +18,7 @@ package org.apache.lucene.search;
  */
 
 import org.apache.lucene.index.LeafReaderContext;
+import org.apache.lucene.util.BitDocIdSet;
 import org.apache.lucene.util.FixedBitSet;
 import org.apache.lucene.util.Bits;
 
@@ -27,7 +28,8 @@ public class MockFilter extends Filter {
   @Override
   public DocIdSet getDocIdSet(LeafReaderContext context, Bits acceptDocs) {
     wasCalled = true;
-    return new FixedBitSet(context.reader().maxDoc());
+    FixedBitSet bits = new FixedBitSet(context.reader().maxDoc());
+    return new BitDocIdSet(bits);
   }
 
   public void clear() {

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/SingleDocTestFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/SingleDocTestFilter.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/SingleDocTestFilter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/SingleDocTestFilter.java Tue Oct 28 09:19:21 2014
@@ -17,12 +17,13 @@ package org.apache.lucene.search;
  * limitations under the License.
  */
 
+import java.io.IOException;
+
 import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.util.Bits;
+import org.apache.lucene.util.BitDocIdSet;
 import org.apache.lucene.util.FixedBitSet;
 
-import java.io.IOException;
-
 public class SingleDocTestFilter extends Filter {
   private int doc;
 
@@ -35,6 +36,6 @@ public class SingleDocTestFilter extends
     FixedBitSet bits = new FixedBitSet(context.reader().maxDoc());
     bits.set(doc);
     if (acceptDocs != null && !acceptDocs.get(doc)) bits.clear(doc);
-    return bits;
+    return new BitDocIdSet(bits);
   }
 }

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java Tue Oct 28 09:19:21 2014
@@ -32,6 +32,7 @@ import org.apache.lucene.index.SlowCompo
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.Bits;
+import org.apache.lucene.util.BitDocIdSet;
 import org.apache.lucene.util.FixedBitSet;
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.LuceneTestCase;
@@ -264,7 +265,7 @@ public class TestCachingWrapperFilter ex
     assertDocIdSetCacheable(reader, new Filter() {
       @Override
       public DocIdSet getDocIdSet(LeafReaderContext context, Bits acceptDocs) {
-        return new FixedBitSet(context.reader().maxDoc());
+        return new BitDocIdSet(new FixedBitSet(context.reader().maxDoc()));
       }
     }, true);
 

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestFilteredQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestFilteredQuery.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestFilteredQuery.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestFilteredQuery.java Tue Oct 28 09:19:21 2014
@@ -34,6 +34,7 @@ import org.apache.lucene.search.BooleanC
 import org.apache.lucene.search.FilteredQuery.FilterStrategy;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.Bits;
+import org.apache.lucene.util.BitDocIdSet;
 import org.apache.lucene.util.FixedBitSet;
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.LuceneTestCase;
@@ -104,7 +105,7 @@ public class TestFilteredQuery extends L
         FixedBitSet bitset = new FixedBitSet(context.reader().maxDoc());
         if (acceptDocs.get(1)) bitset.set(1);
         if (acceptDocs.get(3)) bitset.set(3);
-        return bitset;
+        return new BitDocIdSet(bitset);
       }
     };
   }
@@ -185,7 +186,7 @@ public class TestFilteredQuery extends L
         assertNull("acceptDocs should be null, as we have an index without deletions", acceptDocs);
         FixedBitSet bitset = new FixedBitSet(context.reader().maxDoc());
         bitset.set(0, Math.min(5, bitset.length()));
-        return bitset;
+        return new BitDocIdSet(bitset);
       }
     };
   }

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestFilteredSearch.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestFilteredSearch.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestFilteredSearch.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestFilteredSearch.java Tue Oct 28 09:19:21 2014
@@ -31,6 +31,7 @@ import org.apache.lucene.index.LeafReade
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.Bits;
+import org.apache.lucene.util.BitDocIdSet;
 import org.apache.lucene.util.FixedBitSet;
 import org.apache.lucene.util.LuceneTestCase;
 
@@ -99,7 +100,7 @@ public class TestFilteredSearch extends 
           set.set(docId-docBase);
         }
       }
-      return set.cardinality() == 0 ? null:set;
+      return set.cardinality() == 0 ? null : new BitDocIdSet(set);
     }
   }
 

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestScorerPerf.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestScorerPerf.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestScorerPerf.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestScorerPerf.java Tue Oct 28 09:19:21 2014
@@ -14,6 +14,7 @@ import org.apache.lucene.index.LeafReade
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.Bits;
+import org.apache.lucene.util.BitDocIdSet;
 import org.apache.lucene.util.FixedBitSet;
 import org.apache.lucene.util.LuceneTestCase;
 
@@ -145,7 +146,7 @@ public class TestScorerPerf extends Luce
       @Override
       public DocIdSet getDocIdSet (LeafReaderContext context, Bits acceptDocs) {
         assertNull("acceptDocs should be null, as we have an index without deletions", acceptDocs);
-        return rnd;
+        return new BitDocIdSet(rnd);
       }
     });
     bq.add(q, BooleanClause.Occur.MUST);

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java Tue Oct 28 09:19:21 2014
@@ -39,6 +39,7 @@ import org.apache.lucene.search.BooleanC
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.BitDocIdSet;
 import org.apache.lucene.util.FixedBitSet;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
@@ -260,7 +261,7 @@ public class TestSortRandom extends Luce
         }
       }
 
-      return bits;
+      return new BitDocIdSet(bits);
     }
   }
 }

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestDocIdSetBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestDocIdSetBuilder.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestDocIdSetBuilder.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestDocIdSetBuilder.java Tue Oct 28 09:19:21 2014
@@ -45,6 +45,16 @@ public class TestDocIdSetBuilder extends
     }
   }
 
+  public void testFull() throws IOException {
+    final int maxDoc = 1 + random().nextInt(1000);
+    DocIdSetBuilder builder = new DocIdSetBuilder(maxDoc, true);
+    DocIdSet set = builder.build();
+    DocIdSetIterator it = set.iterator();
+    for (int i = 0; i < maxDoc; ++i) {
+      assertEquals(i, it.nextDoc());
+    }
+  }
+
   public void testSparse() throws IOException {
     final int maxDoc = 1000000 + random().nextInt(1000000);
     DocIdSetBuilder builder = new DocIdSetBuilder(maxDoc);
@@ -60,8 +70,8 @@ public class TestDocIdSetBuilder extends
       builder.or(b.build().iterator());
     }
     DocIdSet result = builder.build();
-    assertTrue(result instanceof SparseFixedBitSet);
-    assertEquals(ref, result);
+    assertTrue(result instanceof BitDocIdSet);
+    assertEquals(new BitDocIdSet(ref), result);
   }
 
   public void testDense() throws IOException {
@@ -76,17 +86,16 @@ public class TestDocIdSetBuilder extends
       builder.or(new RoaringDocIdSet.Builder(maxDoc).add(doc).build().iterator());
     }
     for (int i = 0; i < numIterators; ++i) {
-      final int baseInc = 2 + random().nextInt(10);
       RoaringDocIdSet.Builder b = new RoaringDocIdSet.Builder(maxDoc);
-      for (int doc = random().nextInt(10000); doc < maxDoc; doc += baseInc + random().nextInt(2000)) {
+      for (int doc = random().nextInt(1000); doc < maxDoc; doc += 1 + random().nextInt(1000)) {
         b.add(doc);
         ref.set(doc);
       }
       builder.or(b.build().iterator());
     }
     DocIdSet result = builder.build();
-    assertTrue(result instanceof FixedBitSet);
-    assertEquals(ref, result);
+    assertTrue(result instanceof BitDocIdSet);
+    assertEquals(new BitDocIdSet(ref), result);
   }
 
 }

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java Tue Oct 28 09:19:21 2014
@@ -1,3 +1,5 @@
+package org.apache.lucene.util;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -15,25 +17,23 @@
  * limitations under the License.
  */
 
-package org.apache.lucene.util;
-
 import java.io.IOException;
-import java.util.BitSet;
 
 import org.apache.lucene.search.DocIdSetIterator;
 
-public class TestFixedBitSet extends BaseDocIdSetTestCase<FixedBitSet> {
+public class TestFixedBitSet extends BaseBitSetTestCase<FixedBitSet> {
 
   @Override
   public FixedBitSet copyOf(BitSet bs, int length) throws IOException {
     final FixedBitSet set = new FixedBitSet(length);
-    for (int doc = bs.nextSetBit(0); doc != -1; doc = bs.nextSetBit(doc + 1)) {
+    for (int doc = bs.nextSetBit(0); doc != DocIdSetIterator.NO_MORE_DOCS; doc = doc + 1 >= length ? DocIdSetIterator.NO_MORE_DOCS : bs.nextSetBit(doc + 1)) {
       set.set(doc);
     }
     return set;
   }
 
-  void doGet(BitSet a, FixedBitSet b) {
+
+  void doGet(java.util.BitSet a, FixedBitSet b) {
     int max = b.length();
     for (int i=0; i<max; i++) {
       if (a.get(i) != b.get(i)) {
@@ -42,16 +42,19 @@ public class TestFixedBitSet extends Bas
     }
   }
 
-  void doNextSetBit(BitSet a, FixedBitSet b) {
+  void doNextSetBit(java.util.BitSet a, FixedBitSet b) {
     int aa=-1,bb=-1;
     do {
       aa = a.nextSetBit(aa+1);
-      bb = bb < b.length()-1 ? b.nextSetBit(bb+1) : -1;
+      if (aa == -1) {
+        aa = DocIdSetIterator.NO_MORE_DOCS;
+      }
+      bb = bb < b.length()-1 ? b.nextSetBit(bb+1) : DocIdSetIterator.NO_MORE_DOCS;
       assertEquals(aa,bb);
-    } while (aa>=0);
+    } while (aa != DocIdSetIterator.NO_MORE_DOCS);
   }
 
-  void doPrevSetBit(BitSet a, FixedBitSet b) {
+  void doPrevSetBit(java.util.BitSet a, FixedBitSet b) {
     int aa = a.size() + random().nextInt(100);
     int bb = aa;
     do {
@@ -74,14 +77,14 @@ public class TestFixedBitSet extends Bas
   }
 
   // test interleaving different FixedBitSetIterator.next()/skipTo()
-  void doIterate(BitSet a, FixedBitSet b, int mode) throws IOException {
+  void doIterate(java.util.BitSet a, FixedBitSet b, int mode) throws IOException {
     if (mode==1) doIterate1(a, b);
     if (mode==2) doIterate2(a, b);
   }
 
-  void doIterate1(BitSet a, FixedBitSet b) throws IOException {
+  void doIterate1(java.util.BitSet a, FixedBitSet b) throws IOException {
     int aa=-1,bb=-1;
-    DocIdSetIterator iterator = b.iterator();
+    DocIdSetIterator iterator = new BitSetIterator(b, 0);
     do {
       aa = a.nextSetBit(aa+1);
       bb = (bb < b.length() && random().nextBoolean()) ? iterator.nextDoc() : iterator.advance(bb + 1);
@@ -89,9 +92,9 @@ public class TestFixedBitSet extends Bas
     } while (aa>=0);
   }
 
-  void doIterate2(BitSet a, FixedBitSet b) throws IOException {
+  void doIterate2(java.util.BitSet a, FixedBitSet b) throws IOException {
     int aa=-1,bb=-1;
-    DocIdSetIterator iterator = b.iterator();
+    DocIdSetIterator iterator = new BitSetIterator(b, 0);
     do {
       aa = a.nextSetBit(aa+1);
       bb = random().nextBoolean() ? iterator.nextDoc() : iterator.advance(bb + 1);
@@ -100,12 +103,12 @@ public class TestFixedBitSet extends Bas
   }
 
   void doRandomSets(int maxSize, int iter, int mode) throws IOException {
-    BitSet a0=null;
+    java.util.BitSet a0=null;
     FixedBitSet b0=null;
 
     for (int i=0; i<iter; i++) {
       int sz = TestUtil.nextInt(random(), 2, maxSize);
-      BitSet a = new BitSet(sz);
+      java.util.BitSet a = new java.util.BitSet(sz);
       FixedBitSet b = new FixedBitSet(sz);
 
       // test the various ways of setting bits
@@ -123,12 +126,12 @@ public class TestFixedBitSet extends Bas
           b.clear(idx);
           
           idx = random().nextInt(sz);
-          a.flip(idx);
+          a.flip(idx, idx+1);
           b.flip(idx, idx+1);
 
           idx = random().nextInt(sz);
           a.flip(idx);
-          b.flip(idx, idx+1);
+          b.flip(idx);
 
           boolean val2 = b.get(idx);
           boolean val = b.getAndSet(idx);
@@ -147,14 +150,14 @@ public class TestFixedBitSet extends Bas
       int fromIndex, toIndex;
       fromIndex = random().nextInt(sz/2);
       toIndex = fromIndex + random().nextInt(sz - fromIndex);
-      BitSet aa = (BitSet)a.clone(); aa.flip(fromIndex,toIndex);
+      java.util.BitSet aa = (java.util.BitSet)a.clone(); aa.flip(fromIndex,toIndex);
       FixedBitSet bb = b.clone(); bb.flip(fromIndex,toIndex);
 
       doIterate(aa,bb, mode);   // a problem here is from flip or doIterate
 
       fromIndex = random().nextInt(sz/2);
       toIndex = fromIndex + random().nextInt(sz - fromIndex);
-      aa = (BitSet)a.clone(); aa.clear(fromIndex,toIndex);
+      aa = (java.util.BitSet)a.clone(); aa.clear(fromIndex,toIndex);
       bb = b.clone(); bb.clear(fromIndex,toIndex);
 
       doNextSetBit(aa,bb); // a problem here is from clear() or nextSetBit
@@ -163,7 +166,7 @@ public class TestFixedBitSet extends Bas
 
       fromIndex = random().nextInt(sz/2);
       toIndex = fromIndex + random().nextInt(sz - fromIndex);
-      aa = (BitSet)a.clone(); aa.set(fromIndex,toIndex);
+      aa = (java.util.BitSet)a.clone(); aa.set(fromIndex,toIndex);
       bb = b.clone(); bb.set(fromIndex,toIndex);
 
       doNextSetBit(aa,bb); // a problem here is from set() or nextSetBit
@@ -173,10 +176,10 @@ public class TestFixedBitSet extends Bas
       if (b0 != null && b0.length() <= b.length()) {
         assertEquals(a.cardinality(), b.cardinality());
 
-        BitSet a_and = (BitSet)a.clone(); a_and.and(a0);
-        BitSet a_or = (BitSet)a.clone(); a_or.or(a0);
-        BitSet a_xor = (BitSet)a.clone(); a_xor.xor(a0);
-        BitSet a_andn = (BitSet)a.clone(); a_andn.andNot(a0);
+        java.util.BitSet a_and = (java.util.BitSet)a.clone(); a_and.and(a0);
+        java.util.BitSet a_or = (java.util.BitSet)a.clone(); a_or.or(a0);
+        java.util.BitSet a_xor = (java.util.BitSet)a.clone(); a_xor.xor(a0);
+        java.util.BitSet a_andn = (java.util.BitSet)a.clone(); a_andn.andNot(a0);
 
         FixedBitSet b_and = b.clone(); assertEquals(b,b_and); b_and.and(b0);
         FixedBitSet b_or = b.clone(); b_or.or(b0);
@@ -201,7 +204,7 @@ public class TestFixedBitSet extends Bas
       b0=b;
     }
   }
-  
+
   // large enough to flush obvious bugs, small enough to run in <.5 sec as part of a
   // larger testsuite.
   public void testSmall() throws IOException {
@@ -296,8 +299,8 @@ public class TestFixedBitSet extends Bas
     return bs;
   }
 
-  private BitSet makeBitSet(int[] a) {
-    BitSet bs = new BitSet();
+  private java.util.BitSet makeBitSet(int[] a) {
+    java.util.BitSet bs = new java.util.BitSet();
     for (int e: a) {
       bs.set(e);
     }
@@ -306,7 +309,7 @@ public class TestFixedBitSet extends Bas
 
   private void checkPrevSetBitArray(int [] a, int numBits) {
     FixedBitSet obs = makeFixedBitSet(a, numBits);
-    BitSet bs = makeBitSet(a);
+    java.util.BitSet bs = makeBitSet(a);
     doPrevSetBit(bs, obs);
   }
 
@@ -319,7 +322,7 @@ public class TestFixedBitSet extends Bas
   
   private void checkNextSetBitArray(int [] a, int numBits) {
     FixedBitSet obs = makeFixedBitSet(a, numBits);
-    BitSet bs = makeBitSet(a);
+    java.util.BitSet bs = makeBitSet(a);
     doNextSetBit(bs, obs);
   }
   
@@ -359,5 +362,4 @@ public class TestFixedBitSet extends Bas
     assertTrue(bits.get(1));
     assertFalse(newBits.get(1));
   }
-  
 }

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestNotDocIdSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestNotDocIdSet.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestNotDocIdSet.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestNotDocIdSet.java Tue Oct 28 09:19:21 2014
@@ -30,7 +30,7 @@ public class TestNotDocIdSet extends Bas
     for (int doc = bs.nextClearBit(0); doc < length; doc = bs.nextClearBit(doc + 1)) {
       set.set(doc);
     }
-    return new NotDocIdSet(length, set);
+    return new NotDocIdSet(length, new BitDocIdSet(set));
   }
 
   @Override
@@ -48,7 +48,7 @@ public class TestNotDocIdSet extends Bas
 
   public void testBits() throws IOException {
     assertNull(new NotDocIdSet(3, DocIdSet.EMPTY).bits());
-    assertNotNull(new NotDocIdSet(3, new FixedBitSet(3)).bits());
+    assertNotNull(new NotDocIdSet(3, new BitDocIdSet(new FixedBitSet(3))).bits());
   }
 
 }

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestSparseFixedBitSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestSparseFixedBitSet.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestSparseFixedBitSet.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestSparseFixedBitSet.java Tue Oct 28 09:19:21 2014
@@ -18,43 +18,35 @@ package org.apache.lucene.util;
  */
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.List;
 
-public class TestSparseFixedBitSet extends BaseDocIdSetTestCase<SparseFixedBitSet> {
+import org.apache.lucene.search.DocIdSetIterator;
+
+public class TestSparseFixedBitSet extends BaseBitSetTestCase<SparseFixedBitSet> {
 
   @Override
   public SparseFixedBitSet copyOf(BitSet bs, int length) throws IOException {
     final SparseFixedBitSet set = new SparseFixedBitSet(length);
-    // SparseFixedBitSet can be sensitive to the order of insertion so
-    // randomize insertion a bit
-    List<Integer> buffer = new ArrayList<>();
-    for (int doc = bs.nextSetBit(0); doc != -1; doc = bs.nextSetBit(doc + 1)) {
-      buffer.add(doc);
-      if (buffer.size() >= 100000) {
-        Collections.shuffle(buffer, random());
-        for (int i : buffer) {
-          set.set(i);
-        }
-        buffer.clear();
-      }
-    }
-    Collections.shuffle(buffer, random());
-    for (int i : buffer) {
-      set.set(i);
+    for (int doc = bs.nextSetBit(0); doc != DocIdSetIterator.NO_MORE_DOCS; doc = doc + 1 >= length ? DocIdSetIterator.NO_MORE_DOCS : bs.nextSetBit(doc + 1)) {
+      set.set(doc);
     }
     return set;
   }
 
   @Override
-  public void assertEquals(int numBits, BitSet ds1, SparseFixedBitSet ds2) throws IOException {
-    for (int i = 0; i < numBits; ++i) {
-      assertEquals(ds1.get(i), ds2.get(i));
+  protected void assertEquals(BitSet set1, SparseFixedBitSet set2, int maxDoc) {
+    super.assertEquals(set1, set2, maxDoc);
+    // check invariants of the sparse set
+    int nonZeroLongCount = 0;
+    for (int i = 0; i < set2.indices.length; ++i) {
+      final int n = Long.bitCount(set2.indices[i]);
+      if (n != 0) {
+        nonZeroLongCount += n;
+        for (int j = n; j < set2.bits[i].length; ++j) {
+          assertEquals(0, set2.bits[i][j]);
+        }
+      }
     }
-    assertEquals(ds1.cardinality(), ds2.cardinality());
-    super.assertEquals(numBits, ds1, ds2);
+    assertEquals(nonZeroLongCount, set2.nonZeroLongCount);
   }
 
   public void testApproximateCardinality() {
@@ -70,12 +62,11 @@ public class TestSparseFixedBitSet exten
   public void testApproximateCardinalityOnDenseSet() {
     // this tests that things work as expected in approximateCardinality when
     // all longs are different than 0, in which case we divide by zero
-    final int numDocs = 70;//TestUtil.nextInt(random(), 1, 10000);
+    final int numDocs = TestUtil.nextInt(random(), 1, 10000);
     final SparseFixedBitSet set = new SparseFixedBitSet(numDocs);
     for (int i = 0; i < set.length(); ++i) {
       set.set(i);
     }
     assertEquals(numDocs, set.approximateCardinality());
   }
-
 }

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestVersion.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestVersion.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestVersion.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/util/TestVersion.java Tue Oct 28 09:19:21 2014
@@ -32,37 +32,25 @@ public class TestVersion extends LuceneT
         assertTrue("LATEST must be always onOrAfter("+v+")", Version.LATEST.onOrAfter(v));
       }
     }
-    assertTrue(Version.LUCENE_5_0_0.onOrAfter(Version.LUCENE_4_0_0));
-    assertFalse(Version.LUCENE_4_0_0.onOrAfter(Version.LUCENE_5_0_0));
-    assertTrue(Version.LUCENE_4_0_0_ALPHA.onOrAfter(Version.LUCENE_4_0_0_ALPHA));
-    assertTrue(Version.LUCENE_4_0_0_BETA.onOrAfter(Version.LUCENE_4_0_0_ALPHA));
-    assertTrue(Version.LUCENE_4_0_0.onOrAfter(Version.LUCENE_4_0_0_ALPHA));
-    assertTrue(Version.LUCENE_4_0_0.onOrAfter(Version.LUCENE_4_0_0_BETA));
+    assertTrue(Version.LUCENE_6_0_0.onOrAfter(Version.LUCENE_5_0_0));;
   }
 
   public void testToString() {
-    assertEquals("4.2.0", Version.LUCENE_4_2_0.toString());
-    assertEquals("4.2.0", Version.LUCENE_4_2.toString());
-    assertEquals("4.2.1", Version.LUCENE_4_2_1.toString());
-    assertEquals("4.0.0", Version.LUCENE_4_0_0_ALPHA.toString());
-    assertEquals("4.0.0.1", Version.LUCENE_4_0_0_BETA.toString());
-    assertEquals("4.0.0.2", Version.LUCENE_4_0_0.toString());
+    assertEquals("5.0.0", Version.LUCENE_5_0_0.toString());
+    assertEquals("6.0.0", Version.LUCENE_6_0_0.toString());
   }
 
   public void testParseLeniently() throws Exception {
-    assertEquals(Version.LUCENE_4_9_0, Version.parseLeniently("LUCENE_49"));
-    assertEquals(Version.LUCENE_4_9_0, Version.parseLeniently("LUCENE_4_9"));
-    assertEquals(Version.LUCENE_4_9_0, Version.parseLeniently("LUCENE_4_9_0"));
-    assertEquals(Version.LUCENE_4_9_0, Version.parseLeniently("lucene_49"));
-    assertEquals(Version.LUCENE_4_9_0, Version.parseLeniently("Lucene_4_9"));
-    assertEquals(Version.LUCENE_4_9_0, Version.parseLeniently("Lucene_4_9_0"));
-    assertEquals(Version.LUCENE_4_10_0, Version.parseLeniently("LUCENE_4_10"));
-    assertEquals(Version.LUCENE_4_10_0, Version.parseLeniently("LUCENE_4_10_0"));
-    assertEquals(Version.LUCENE_4_0_0_ALPHA, Version.parseLeniently("4.0"));
-    assertEquals(Version.LUCENE_4_0_0_ALPHA, Version.parseLeniently("4.0.0"));
-    assertEquals(Version.LUCENE_4_0_0_ALPHA, Version.parseLeniently("LUCENE_40"));
-    assertEquals(Version.LUCENE_4_0_0_ALPHA, Version.parseLeniently("LUCENE_4_0"));
-    assertEquals(Version.LUCENE_4_0_0, Version.parseLeniently("LUCENE_4_0_0"));
+    assertEquals(Version.LUCENE_5_0_0, Version.parseLeniently("5.0"));
+    assertEquals(Version.LUCENE_5_0_0, Version.parseLeniently("5.0.0"));
+    assertEquals(Version.LUCENE_5_0_0, Version.parseLeniently("LUCENE_50"));
+    assertEquals(Version.LUCENE_5_0_0, Version.parseLeniently("LUCENE_5_0"));
+    assertEquals(Version.LUCENE_5_0_0, Version.parseLeniently("LUCENE_5_0_0"));
+    assertEquals(Version.LUCENE_6_0_0, Version.parseLeniently("6.0"));
+    assertEquals(Version.LUCENE_6_0_0, Version.parseLeniently("6.0.0"));
+    assertEquals(Version.LUCENE_6_0_0, Version.parseLeniently("LUCENE_60"));
+    assertEquals(Version.LUCENE_6_0_0, Version.parseLeniently("LUCENE_6_0"));
+    assertEquals(Version.LUCENE_6_0_0, Version.parseLeniently("LUCENE_6_0_0"));
     assertEquals(Version.LATEST, Version.parseLeniently("LATEST"));
     assertEquals(Version.LATEST, Version.parseLeniently("latest"));
     assertEquals(Version.LATEST, Version.parseLeniently("LUCENE_CURRENT"));
@@ -78,18 +66,18 @@ public class TestVersion extends LuceneT
       assertTrue(pe.getMessage().contains("LUCENE"));
     }
     try {
-      Version.parseLeniently("LUCENE_410");
+      Version.parseLeniently("LUCENE_610");
       fail();
     } catch (ParseException pe) {
       // pass
-      assertTrue(pe.getMessage().contains("LUCENE_410"));
+      assertTrue(pe.getMessage().contains("LUCENE_610"));
     }
     try {
-      Version.parseLeniently("LUCENE41");
+      Version.parseLeniently("LUCENE61");
       fail();
     } catch (ParseException pe) {
       // pass
-      assertTrue(pe.getMessage().contains("LUCENE41"));
+      assertTrue(pe.getMessage().contains("LUCENE61"));
     }
     try {
       Version.parseLeniently("LUCENE_6.0.0");
@@ -115,119 +103,113 @@ public class TestVersion extends LuceneT
   }
 
   public void testParse() throws Exception {
+    assertEquals(Version.LUCENE_6_0_0, Version.parse("6.0.0"));
     assertEquals(Version.LUCENE_5_0_0, Version.parse("5.0.0"));
-    assertEquals(Version.LUCENE_4_1_0, Version.parse("4.1"));
-    assertEquals(Version.LUCENE_4_1_0, Version.parse("4.1.0"));
-    assertEquals(Version.LUCENE_4_0_0_ALPHA, Version.parse("4.0.0"));
-    assertEquals(Version.LUCENE_4_0_0_BETA, Version.parse("4.0.0.1"));
-    assertEquals(Version.LUCENE_4_0_0, Version.parse("4.0.0.2"));
     
     // Version does not pass judgement on the major version:
     assertEquals(1, Version.parse("1.0").major);
-    assertEquals(6, Version.parse("6.0.0").major);
+    assertEquals(7, Version.parse("7.0.0").major);
   }
 
   public void testForwardsCompatibility() throws Exception {
-    assertTrue(Version.parse("4.7.10").onOrAfter(Version.LUCENE_4_7_2));
-    assertTrue(Version.parse("4.20.0").onOrAfter(Version.LUCENE_4_8_1));
     assertTrue(Version.parse("5.10.20").onOrAfter(Version.LUCENE_5_0_0));
   }
 
   public void testParseExceptions() {
     try {
-      Version.parse("LUCENE_4_0_0");
+      Version.parse("LUCENE_6_0_0");
       fail();
     } catch (ParseException pe) {
       // pass
-      assertTrue(pe.getMessage().contains("LUCENE_4_0_0"));
+      assertTrue(pe.getMessage().contains("LUCENE_6_0_0"));
     }
 
     try {
-      Version.parse("4.256");
+      Version.parse("6.256");
       fail();
     } catch (ParseException pe) {
       // pass
-      assertTrue(pe.getMessage().contains("4.256"));
+      assertTrue(pe.getMessage().contains("6.256"));
     }
 
     try {
-      Version.parse("4.-1");
+      Version.parse("6.-1");
       fail();
     } catch (ParseException pe) {
       // pass
-      assertTrue(pe.getMessage().contains("4.-1"));
+      assertTrue(pe.getMessage().contains("6.-1"));
     }
 
     try {
-      Version.parse("4.1.256");
+      Version.parse("6.1.256");
       fail();
     } catch (ParseException pe) {
       // pass
-      assertTrue(pe.getMessage().contains("4.1.256"));
+      assertTrue(pe.getMessage().contains("6.1.256"));
     }
 
     try {
-      Version.parse("4.1.-1");
+      Version.parse("6.1.-1");
       fail();
     } catch (ParseException pe) {
       // pass
-      assertTrue(pe.getMessage().contains("4.1.-1"));
+      assertTrue(pe.getMessage().contains("6.1.-1"));
     }
 
     try {
-      Version.parse("4.1.1.3");
+      Version.parse("6.1.1.3");
       fail();
     } catch (ParseException pe) {
       // pass
-      assertTrue(pe.getMessage().contains("4.1.1.3"));
+      assertTrue(pe.getMessage().contains("6.1.1.3"));
     }
 
     try {
-      Version.parse("4.1.1.-1");
+      Version.parse("6.1.1.-1");
       fail();
     } catch (ParseException pe) {
       // pass
-      assertTrue(pe.getMessage().contains("4.1.1.-1"));
+      assertTrue(pe.getMessage().contains("6.1.1.-1"));
     }
 
     try {
-      Version.parse("4.1.1.1");
+      Version.parse("6.1.1.1");
       fail();
     } catch (ParseException pe) {
       // pass
-      assertTrue(pe.getMessage().contains("4.1.1.1"));
+      assertTrue(pe.getMessage().contains("6.1.1.1"));
     }
 
     try {
-      Version.parse("4.1.1.2");
+      Version.parse("6.1.1.2");
       fail();
     } catch (ParseException pe) {
       // pass
-      assertTrue(pe.getMessage().contains("4.1.1.2"));
+      assertTrue(pe.getMessage().contains("6.1.1.2"));
     }
 
     try {
-      Version.parse("4.0.0.0");
+      Version.parse("6.0.0.0");
       fail();
     } catch (ParseException pe) {
       // pass
-      assertTrue(pe.getMessage().contains("4.0.0.0"));
+      assertTrue(pe.getMessage().contains("6.0.0.0"));
     }
 
     try {
-      Version.parse("4.0.0.1.42");
+      Version.parse("6.0.0.1.42");
       fail();
     } catch (ParseException pe) {
       // pass
-      assertTrue(pe.getMessage().contains("4.0.0.1.42"));
+      assertTrue(pe.getMessage().contains("6.0.0.1.42"));
     }
 
     try {
-      Version.parse("4..0.1");
+      Version.parse("6..0.1");
       fail();
     } catch (ParseException pe) {
       // pass
-      assertTrue(pe.getMessage().contains("4..0.1"));
+      assertTrue(pe.getMessage().contains("6..0.1"));
     }
   }
   

Modified: lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/DrillSidewaysScorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/DrillSidewaysScorer.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/DrillSidewaysScorer.java (original)
+++ lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/DrillSidewaysScorer.java Tue Oct 28 09:19:21 2014
@@ -330,7 +330,7 @@ class DrillSidewaysScorer extends BulkSc
       // Fold in baseScorer, using advance:
       int filledCount = 0;
       int slot0 = 0;
-      while (slot0 < CHUNK && (slot0 = seen.nextSetBit(slot0)) != -1) {
+      while (slot0 < CHUNK && (slot0 = seen.nextSetBit(slot0)) != DocIdSetIterator.NO_MORE_DOCS) {
         int ddDocID = docIDs[slot0];
         assert ddDocID != -1;
 

Modified: lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java (original)
+++ lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java Tue Oct 28 09:19:21 2014
@@ -40,6 +40,7 @@ import org.apache.lucene.search.TopField
 import org.apache.lucene.search.TopFieldDocs;
 import org.apache.lucene.search.TopScoreDocCollector;
 import org.apache.lucene.util.ArrayUtil;
+import org.apache.lucene.util.BitDocIdSet;
 import org.apache.lucene.util.FixedBitSet;
 
 /** Collects hits for subsequent faceting.  Once you've run
@@ -128,7 +129,7 @@ public class FacetsCollector extends Sim
       
       @Override
       public DocIdSet getDocIdSet() {
-        return bits;
+        return new BitDocIdSet(bits);
       }
     };
   }

Modified: lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/RandomSamplingFacetsCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/RandomSamplingFacetsCollector.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/RandomSamplingFacetsCollector.java (original)
+++ lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/RandomSamplingFacetsCollector.java Tue Oct 28 09:19:21 2014
@@ -26,6 +26,7 @@ import org.apache.lucene.index.IndexRead
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.util.BitDocIdSet;
 import org.apache.lucene.util.FixedBitSet;
 
 /**
@@ -212,7 +213,7 @@ public class RandomSamplingFacetsCollect
         }
       }
       
-      return new MatchingDocs(docs.context, sampleDocs, docs.totalHits, null);
+      return new MatchingDocs(docs.context, new BitDocIdSet(sampleDocs), docs.totalHits, null);
     } catch (IOException e) {
       throw new RuntimeException();
     }

Modified: lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java Tue Oct 28 09:19:21 2014
@@ -131,8 +131,7 @@ public class DirectoryTaxonomyWriter imp
 
   /** Reads the commit data from a Directory. */
   private static Map<String, String> readCommitData(Directory dir) throws IOException {
-    SegmentInfos infos = new SegmentInfos();
-    infos.read(dir);
+    SegmentInfos infos = SegmentInfos.readLatestCommit(dir);
     return infos.getUserData();
   }
   

Modified: lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java (original)
+++ lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java Tue Oct 28 09:19:21 2014
@@ -58,6 +58,7 @@ import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.BitDocIdSet;
 import org.apache.lucene.util.FixedBitSet;
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.InPlaceMergeSorter;
@@ -657,7 +658,7 @@ public class TestDrillSideways extends F
                   bits.set(docID);
                 }
               }
-              return bits;
+              return new BitDocIdSet(bits);
             }
           };
       } else {

Modified: lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java (original)
+++ lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java Tue Oct 28 09:19:21 2014
@@ -65,6 +65,7 @@ import org.apache.lucene.search.NumericR
 import org.apache.lucene.search.NumericRangeQuery;
 import org.apache.lucene.search.QueryWrapperFilter;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.util.BitDocIdSet;
 import org.apache.lucene.util.FixedBitSet;
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.TestUtil;
@@ -926,7 +927,7 @@ public class TestRangeFacetCounts extend
             final FixedBitSet cached = new FixedBitSet(reader.maxDoc());
             filterWasUsed.set(true);
             cached.or(iterator);
-            return cached;
+            return new BitDocIdSet(cached);
           }
         };
     } else {

Modified: lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java Tue Oct 28 09:19:21 2014
@@ -324,8 +324,7 @@ public class TestDirectoryTaxonomyWriter
   }
 
   private long getEpoch(Directory taxoDir) throws IOException {
-    SegmentInfos infos = new SegmentInfos();
-    infos.read(taxoDir);
+    SegmentInfos infos = SegmentInfos.readLatestCommit(taxoDir);
     return Long.parseLong(infos.getUserData().get(DirectoryTaxonomyWriter.INDEX_EPOCH));
   }
   

Modified: lucene/dev/branches/lucene6005/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java (original)
+++ lucene/dev/branches/lucene6005/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java Tue Oct 28 09:19:21 2014
@@ -406,9 +406,7 @@ public class AllGroupHeadsCollectorTest 
       expected.set(expectedDoc);
     }
 
-    int docId;
-    DocIdSetIterator iterator = expected.iterator();
-    while ((docId = iterator.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
+    for (int docId = expected.nextSetBit(0); docId != DocIdSetIterator.NO_MORE_DOCS; docId = docId + 1 >= expected.length() ? DocIdSetIterator.NO_MORE_DOCS : expected.nextSetBit(docId + 1)) {
       if (!actual.get(docId)) {
         return false;
       }

Modified: lucene/dev/branches/lucene6005/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java (original)
+++ lucene/dev/branches/lucene6005/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java Tue Oct 28 09:19:21 2014
@@ -35,6 +35,7 @@ import org.apache.lucene.index.Directory
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.Term;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.PhraseQuery;
 import org.apache.lucene.search.Query;
@@ -143,7 +144,7 @@ public class HighlighterPhraseTest exten
       final Highlighter highlighter = new Highlighter(
           new SimpleHTMLFormatter(), new SimpleHTMLEncoder(),
           new QueryScorer(phraseQuery));
-      for (int position = bitset.nextSetBit(0); position >= 0 && position < maxDoc-1; position = bitset
+      for (int position = bitset.nextSetBit(0); position < maxDoc-1; position = bitset
           .nextSetBit(position + 1)) {
         assertEquals(0, position);
         final TokenStream tokenStream = TokenSources.getTokenStream(

Modified: lucene/dev/branches/lucene6005/lucene/ivy-versions.properties
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/ivy-versions.properties?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/ivy-versions.properties (original)
+++ lucene/dev/branches/lucene6005/lucene/ivy-versions.properties Tue Oct 28 09:19:21 2014
@@ -60,7 +60,7 @@ com.sun.jersey.version = 1.9
 /commons-configuration/commons-configuration = 1.6
 /commons-digester/commons-digester = 2.1
 /commons-fileupload/commons-fileupload = 1.2.1
-/commons-io/commons-io = 2.3
+/commons-io/commons-io = 2.4
 /commons-lang/commons-lang = 2.6
 /commons-logging/commons-logging = 1.1.3
 /de.l3s.boilerpipe/boilerpipe = 1.1.0

Modified: lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/FixedBitSetCachingWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/FixedBitSetCachingWrapperFilter.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/FixedBitSetCachingWrapperFilter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/FixedBitSetCachingWrapperFilter.java Tue Oct 28 09:19:21 2014
@@ -26,6 +26,7 @@ import org.apache.lucene.search.CachingW
 import org.apache.lucene.search.DocIdSet;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.Filter;
+import org.apache.lucene.util.BitDocIdSet;
 import org.apache.lucene.util.FixedBitSet;
 
 /** A {@link CachingWrapperFilter} that caches sets using a {@link FixedBitSet},
@@ -42,7 +43,7 @@ public final class FixedBitSetCachingWra
       throws IOException {
     if (docIdSet == null) {
       return EMPTY;
-    } else if (docIdSet instanceof FixedBitSet) {
+    } else if (docIdSet instanceof BitDocIdSet) {
       // this is different from CachingWrapperFilter: even when the DocIdSet is
       // cacheable, we convert it to a FixedBitSet since we require all the
       // cached filters to be FixedBitSets
@@ -54,7 +55,7 @@ public final class FixedBitSetCachingWra
       } else {
         final FixedBitSet copy = new FixedBitSet(reader.maxDoc());
         copy.or(it);
-        return copy;
+        return new BitDocIdSet(copy);
       }
     }
   }

Modified: lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/TermsIncludingScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/TermsIncludingScoreQuery.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/TermsIncludingScoreQuery.java (original)
+++ lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/TermsIncludingScoreQuery.java Tue Oct 28 09:19:21 2014
@@ -21,21 +21,22 @@ import java.io.IOException;
 import java.util.Locale;
 import java.util.Set;
 
-import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.DocsEnum;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum;
-import org.apache.lucene.search.LeafCollector;
+import org.apache.lucene.search.BulkScorer;
 import org.apache.lucene.search.ComplexExplanation;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.LeafCollector;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Scorer;
-import org.apache.lucene.search.BulkScorer;
 import org.apache.lucene.search.Weight;
+import org.apache.lucene.util.BitSetIterator;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.BytesRefHash;
@@ -328,7 +329,7 @@ class TermsIncludingScoreQuery extends Q
       FixedBitSet matchingDocs = new FixedBitSet(maxDoc);
       this.scores = new float[maxDoc];
       fillDocsAndScores(matchingDocs, acceptDocs, termsEnum);
-      this.matchingDocsIterator = matchingDocs.iterator();
+      this.matchingDocsIterator = new BitSetIterator(matchingDocs, cost);
       this.cost = cost;
     }
 

Modified: lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java (original)
+++ lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java Tue Oct 28 09:19:21 2014
@@ -22,8 +22,8 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Set;
 
-import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.DocIdSet;
 import org.apache.lucene.search.Explanation;
@@ -33,6 +33,7 @@ import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.search.Weight;
 import org.apache.lucene.util.Bits;
+import org.apache.lucene.util.BitDocIdSet;
 import org.apache.lucene.util.FixedBitSet;
 
 /**
@@ -144,11 +145,11 @@ public class ToChildBlockJoinQuery exten
         // No matches
         return null;
       }
-      if (!(parents instanceof FixedBitSet)) {
-        throw new IllegalStateException("parentFilter must return FixedBitSet; got " + parents);
+      if (!(parents.bits() instanceof FixedBitSet)) {
+        throw new IllegalStateException("parentFilter must return FixedBitSet; got " + parents.bits());
       }
 
-      return new ToChildBlockJoinScorer(this, parentScorer, (FixedBitSet) parents, doScores, acceptDocs);
+      return new ToChildBlockJoinScorer(this, parentScorer, (FixedBitSet) parents.bits(), doScores, acceptDocs);
     }
 
     @Override

Modified: lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinFieldComparator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinFieldComparator.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinFieldComparator.java (original)
+++ lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinFieldComparator.java Tue Oct 28 09:19:21 2014
@@ -17,6 +17,8 @@ package org.apache.lucene.search.join;
  * limitations under the License.
  */
 
+import java.io.IOException;
+
 import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.search.DocIdSet;
 import org.apache.lucene.search.DocIdSetIterator;
@@ -24,8 +26,6 @@ import org.apache.lucene.search.FieldCom
 import org.apache.lucene.search.Filter;
 import org.apache.lucene.util.FixedBitSet;
 
-import java.io.IOException;
-
 /**
  * A field comparator that allows parent documents to be sorted by fields
  * from the nested / child documents.
@@ -69,8 +69,8 @@ public abstract class ToParentBlockJoinF
     DocIdSet innerDocuments = childFilter.getDocIdSet(context, null);
     if (isEmpty(innerDocuments)) {
       this.childDocuments = null;
-    } else if (innerDocuments instanceof FixedBitSet) {
-      this.childDocuments = (FixedBitSet) innerDocuments;
+    } else if (innerDocuments.bits() instanceof FixedBitSet) {
+      this.childDocuments = (FixedBitSet) innerDocuments.bits();
     } else {
       DocIdSetIterator iterator = innerDocuments.iterator();
       if (iterator != null) {
@@ -82,8 +82,8 @@ public abstract class ToParentBlockJoinF
     DocIdSet rootDocuments = parentFilter.getDocIdSet(context, null);
     if (isEmpty(rootDocuments)) {
       this.parentDocuments = null;
-    } else if (rootDocuments instanceof FixedBitSet) {
-      this.parentDocuments = (FixedBitSet) rootDocuments;
+    } else if (rootDocuments.bits() instanceof FixedBitSet) {
+      this.parentDocuments = (FixedBitSet) rootDocuments.bits();
     } else {
       DocIdSetIterator iterator = rootDocuments.iterator();
       if (iterator != null) {
@@ -143,7 +143,7 @@ public abstract class ToParentBlockJoinF
       // We need to copy the lowest value from all child docs into slot.
       int prevParentDoc = parentDocuments.prevSetBit(parentDoc - 1);
       int childDoc = childDocuments.nextSetBit(prevParentDoc + 1);
-      if (childDoc >= parentDoc || childDoc == -1) {
+      if (childDoc >= parentDoc || childDoc == DocIdSetIterator.NO_MORE_DOCS) {
         return 0;
       }
 
@@ -155,7 +155,7 @@ public abstract class ToParentBlockJoinF
 
       while (true) {
         childDoc = childDocuments.nextSetBit(childDoc + 1);
-        if (childDoc >= parentDoc || childDoc == -1) {
+        if (childDoc >= parentDoc || childDoc == DocIdSetIterator.NO_MORE_DOCS) {
           return cmp;
         }
         int cmp1 = wrappedComparator.compareBottom(childDoc);
@@ -178,7 +178,7 @@ public abstract class ToParentBlockJoinF
       // We need to copy the lowest value from all child docs into slot.
       int prevParentDoc = parentDocuments.prevSetBit(parentDoc - 1);
       int childDoc = childDocuments.nextSetBit(prevParentDoc + 1);
-      if (childDoc >= parentDoc || childDoc == -1) {
+      if (childDoc >= parentDoc || childDoc == DocIdSetIterator.NO_MORE_DOCS) {
         return;
       }
       wrappedComparator.copy(spareSlot, childDoc);
@@ -186,7 +186,7 @@ public abstract class ToParentBlockJoinF
 
       while (true) {
         childDoc = childDocuments.nextSetBit(childDoc + 1);
-        if (childDoc >= parentDoc || childDoc == -1) {
+        if (childDoc >= parentDoc || childDoc == DocIdSetIterator.NO_MORE_DOCS) {
           return;
         }
         wrappedComparator.copy(spareSlot, childDoc);
@@ -206,7 +206,7 @@ public abstract class ToParentBlockJoinF
       // We need to copy the lowest value from all nested docs into slot.
       int prevParentDoc = parentDocuments.prevSetBit(parentDoc - 1);
       int childDoc = childDocuments.nextSetBit(prevParentDoc + 1);
-      if (childDoc >= parentDoc || childDoc == -1) {
+      if (childDoc >= parentDoc || childDoc == DocIdSetIterator.NO_MORE_DOCS) {
         return 0;
       }
 
@@ -218,7 +218,7 @@ public abstract class ToParentBlockJoinF
 
       while (true) {
         childDoc = childDocuments.nextSetBit(childDoc + 1);
-        if (childDoc >= parentDoc || childDoc == -1) {
+        if (childDoc >= parentDoc || childDoc == DocIdSetIterator.NO_MORE_DOCS) {
           return cmp;
         }
         int cmp1 = wrappedComparator.compareTop(childDoc);
@@ -261,7 +261,7 @@ public abstract class ToParentBlockJoinF
 
       int prevParentDoc = parentDocuments.prevSetBit(parentDoc - 1);
       int childDoc = childDocuments.nextSetBit(prevParentDoc + 1);
-      if (childDoc >= parentDoc || childDoc == -1) {
+      if (childDoc >= parentDoc || childDoc == DocIdSetIterator.NO_MORE_DOCS) {
         return 0;
       }
 
@@ -272,7 +272,7 @@ public abstract class ToParentBlockJoinF
 
       while (true) {
         childDoc = childDocuments.nextSetBit(childDoc + 1);
-        if (childDoc >= parentDoc || childDoc == -1) {
+        if (childDoc >= parentDoc || childDoc == DocIdSetIterator.NO_MORE_DOCS) {
           return cmp;
         }
         int cmp1 = wrappedComparator.compareBottom(childDoc);
@@ -294,7 +294,7 @@ public abstract class ToParentBlockJoinF
 
       int prevParentDoc = parentDocuments.prevSetBit(parentDoc - 1);
       int childDoc = childDocuments.nextSetBit(prevParentDoc + 1);
-      if (childDoc >= parentDoc || childDoc == -1) {
+      if (childDoc >= parentDoc || childDoc == DocIdSetIterator.NO_MORE_DOCS) {
         return;
       }
       wrappedComparator.copy(spareSlot, childDoc);
@@ -302,7 +302,7 @@ public abstract class ToParentBlockJoinF
 
       while (true) {
         childDoc = childDocuments.nextSetBit(childDoc + 1);
-        if (childDoc >= parentDoc || childDoc == -1) {
+        if (childDoc >= parentDoc || childDoc == DocIdSetIterator.NO_MORE_DOCS) {
           return;
         }
         wrappedComparator.copy(spareSlot, childDoc);
@@ -321,7 +321,7 @@ public abstract class ToParentBlockJoinF
 
       int prevParentDoc = parentDocuments.prevSetBit(parentDoc - 1);
       int childDoc = childDocuments.nextSetBit(prevParentDoc + 1);
-      if (childDoc >= parentDoc || childDoc == -1) {
+      if (childDoc >= parentDoc || childDoc == DocIdSetIterator.NO_MORE_DOCS) {
         return 0;
       }
 
@@ -332,7 +332,7 @@ public abstract class ToParentBlockJoinF
 
       while (true) {
         childDoc = childDocuments.nextSetBit(childDoc + 1);
-        if (childDoc >= parentDoc || childDoc == -1) {
+        if (childDoc >= parentDoc || childDoc == DocIdSetIterator.NO_MORE_DOCS) {
           return cmp;
         }
         int cmp1 = wrappedComparator.compareTop(childDoc);

Modified: lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java (original)
+++ lucene/dev/branches/lucene6005/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java Tue Oct 28 09:19:21 2014
@@ -23,9 +23,9 @@ import java.util.Collections;
 import java.util.Locale;
 import java.util.Set;
 
-import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.ComplexExplanation;
 import org.apache.lucene.search.DocIdSet;
@@ -183,11 +183,11 @@ public class ToParentBlockJoinQuery exte
         // No matches
         return null;
       }
-      if (!(parents instanceof FixedBitSet)) {
-        throw new IllegalStateException("parentFilter must return FixedBitSet; got " + parents);
+      if (!(parents.bits() instanceof FixedBitSet)) {
+        throw new IllegalStateException("parentFilter must return FixedBitSet; got " + parents.bits());
       }
 
-      return new BlockJoinScorer(this, childScorer, (FixedBitSet) parents, firstChildDoc, scoreMode, acceptDocs);
+      return new BlockJoinScorer(this, childScorer, (FixedBitSet) parents.bits(), firstChildDoc, scoreMode, acceptDocs);
     }
 
     @Override
@@ -287,7 +287,7 @@ public class ToParentBlockJoinQuery exte
         }
 
         //System.out.println("  parentDoc=" + parentDoc);
-        assert parentDoc != -1;
+        assert parentDoc != DocIdSetIterator.NO_MORE_DOCS;
 
         //System.out.println("  nextChildDoc=" + nextChildDoc);
         if (acceptDocs != null && !acceptDocs.get(parentDoc)) {

Modified: lucene/dev/branches/lucene6005/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java (original)
+++ lucene/dev/branches/lucene6005/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java Tue Oct 28 09:19:21 2014
@@ -359,7 +359,7 @@ public class TestBlockJoin extends Lucen
     final List<LeafReaderContext> leaves = reader.leaves();
     final int subIndex = ReaderUtil.subIndex(childDocID, leaves);
     final LeafReaderContext leaf = leaves.get(subIndex);
-    final FixedBitSet bits = (FixedBitSet) parents.getDocIdSet(leaf, null);
+    final FixedBitSet bits = (FixedBitSet) parents.getDocIdSet(leaf, null).bits();
     return leaf.reader().document(bits.nextSetBit(childDocID - leaf.docBase));
   }
   

Modified: lucene/dev/branches/lucene6005/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java (original)
+++ lucene/dev/branches/lucene6005/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java Tue Oct 28 09:19:21 2014
@@ -37,12 +37,12 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.document.SortedDocValuesField;
 import org.apache.lucene.document.SortedSetDocValuesField;
 import org.apache.lucene.document.TextField;
-import org.apache.lucene.index.LeafReader;
-import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.BinaryDocValues;
 import org.apache.lucene.index.DocValues;
 import org.apache.lucene.index.DocsEnum;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.LeafReader;
+import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.MultiFields;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.SlowCompositeReaderWrapper;
@@ -64,6 +64,7 @@ import org.apache.lucene.search.TermQuer
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.search.TopScoreDocCollector;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.util.BitSetIterator;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.FixedBitSet;
@@ -504,12 +505,12 @@ public class TestJoinUtil extends Lucene
         // Asserting bit set...
         if (VERBOSE) {
           System.out.println("expected cardinality:" + expectedResult.cardinality());
-          DocIdSetIterator iterator = expectedResult.iterator();
+          DocIdSetIterator iterator = new BitSetIterator(expectedResult, expectedResult.cardinality());
           for (int doc = iterator.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = iterator.nextDoc()) {
             System.out.println(String.format(Locale.ROOT, "Expected doc[%d] with id value %s", doc, indexSearcher.doc(doc).get("id")));
           }
           System.out.println("actual cardinality:" + actualResult.cardinality());
-          iterator = actualResult.iterator();
+          iterator = new BitSetIterator(actualResult, actualResult.cardinality());
           for (int doc = iterator.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = iterator.nextDoc()) {
             System.out.println(String.format(Locale.ROOT, "Actual doc[%d] with id value %s", doc, indexSearcher.doc(doc).get("id")));
           }

Modified: lucene/dev/branches/lucene6005/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java (original)
+++ lucene/dev/branches/lucene6005/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java Tue Oct 28 09:19:21 2014
@@ -208,6 +208,8 @@ public class MemoryIndex {
   private Counter bytesUsed;
 
   private boolean frozen = false;
+
+  private Similarity normSimilarity = IndexSearcher.getDefaultSimilarity();
   
   /**
    * Sorts term entries into ascending order; also works for
@@ -500,6 +502,15 @@ public class MemoryIndex {
   }
 
   /**
+   * Set the Similarity to be used for calculating field norms
+   */
+  public void setSimilarity(Similarity similarity) {
+    if (frozen)
+      throw new IllegalArgumentException("Cannot set Similarity when MemoryIndex is frozen");
+    this.normSimilarity = similarity;
+  }
+
+  /**
    * Creates and returns a searcher that can be used to execute arbitrary
    * Lucene queries and to collect the resulting query results as hits.
    * 
@@ -508,7 +519,7 @@ public class MemoryIndex {
   public IndexSearcher createSearcher() {
     MemoryIndexReader reader = new MemoryIndexReader();
     IndexSearcher searcher = new IndexSearcher(reader); // ensures no auto-close !!
-    reader.setSearcher(searcher); // to later get hold of searcher.getSimilarity()
+    searcher.setSimilarity(normSimilarity);
     return searcher;
   }
 
@@ -524,6 +535,7 @@ public class MemoryIndex {
     for (Map.Entry<String,Info> info : sortedFields) {
       info.getValue().sortTerms();
     }
+    calculateNormValues();
   }
   
   /**
@@ -744,8 +756,6 @@ public class MemoryIndex {
    */
   private final class MemoryIndexReader extends LeafReader {
     
-    private IndexSearcher searcher; // needed to find searcher.getSimilarity() 
-    
     private MemoryIndexReader() {
       super(); // avoid as much superclass baggage as possible
     }
@@ -1169,15 +1179,6 @@ public class MemoryIndex {
         return null;
       }
     }
-
-    private Similarity getSimilarity() {
-      if (searcher != null) return searcher.getSimilarity();
-      return IndexSearcher.getDefaultSimilarity();
-    }
-    
-    private void setSearcher(IndexSearcher searcher) {
-      this.searcher = searcher;
-    }
   
     @Override
     public int numDocs() {
@@ -1202,33 +1203,35 @@ public class MemoryIndex {
       if (DEBUG) System.err.println("MemoryIndexReader.doClose");
     }
     
-    /** performance hack: cache norms to avoid repeated expensive calculations */
-    private NumericDocValues cachedNormValues;
-    private String cachedFieldName;
-    private Similarity cachedSimilarity;
-    
     @Override
     public NumericDocValues getNormValues(String field) {
-      FieldInfo fieldInfo = fieldInfos.get(field);
-      if (fieldInfo == null || fieldInfo.omitsNorms())
-        return null;
-      NumericDocValues norms = cachedNormValues;
-      Similarity sim = getSimilarity();
-      if (!field.equals(cachedFieldName) || sim != cachedSimilarity) { // not cached?
-        Info info = getInfo(field);
-        int numTokens = info != null ? info.numTokens : 0;
-        int numOverlapTokens = info != null ? info.numOverlapTokens : 0;
-        float boost = info != null ? info.getBoost() : 1.0f; 
-        FieldInvertState invertState = new FieldInvertState(field, 0, numTokens, numOverlapTokens, 0, boost);
-        long value = sim.computeNorm(invertState);
-        norms = new MemoryIndexNormDocValues(value);
-        // cache it for future reuse
-        cachedNormValues = norms;
-        cachedFieldName = field;
-        cachedSimilarity = sim;
-        if (DEBUG) System.err.println("MemoryIndexReader.norms: " + field + ":" + value + ":" + numTokens);
-      }
-      return norms;
+      if (norms == null)
+        return calculateFieldNormValue(field);
+      return norms.get(field);
+    }
+
+  }
+
+  private Map<String, NumericDocValues> norms = null;
+
+  private NumericDocValues calculateFieldNormValue(String field) {
+    FieldInfo fieldInfo = fieldInfos.get(field);
+    if (fieldInfo == null)
+      return null;
+    Info info = fields.get(field);
+    int numTokens = info != null ? info.numTokens : 0;
+    int numOverlapTokens = info != null ? info.numOverlapTokens : 0;
+    float boost = info != null ? info.getBoost() : 1.0f;
+    FieldInvertState invertState = new FieldInvertState(field, 0, numTokens, numOverlapTokens, 0, boost);
+    long value = normSimilarity.computeNorm(invertState);
+    if (DEBUG) System.err.println("MemoryIndexReader.norms: " + field + ":" + value + ":" + numTokens);
+    return new MemoryIndexNormDocValues(value);
+  }
+
+  private void calculateNormValues() {
+    norms = new HashMap<>();
+    for (String field : fieldInfos.keySet()) {
+      norms.put(field, calculateFieldNormValue(field));
     }
   }
   
@@ -1239,6 +1242,8 @@ public class MemoryIndex {
     this.fieldInfos.clear();
     this.fields.clear();
     this.sortedFields = null;
+    this.norms = null;
+    this.normSimilarity = IndexSearcher.getDefaultSimilarity();
     byteBlockPool.reset(false, false); // no need to 0-fill the buffers
     intBlockPool.reset(true, false); // here must must 0-fill since we use slices
     this.frozen = false;

Modified: lucene/dev/branches/lucene6005/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java (original)
+++ lucene/dev/branches/lucene6005/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java Tue Oct 28 09:19:21 2014
@@ -18,13 +18,20 @@ package org.apache.lucene.index.memory;
  */
 
 import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.index.LeafReader;
+import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.index.Term;
+import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.MatchAllDocsQuery;
 import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.search.similarities.BM25Similarity;
+import org.apache.lucene.search.similarities.DefaultSimilarity;
 import org.apache.lucene.util.LuceneTestCase;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.io.IOException;
+
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.not;
 import static org.junit.internal.matchers.StringContains.containsString;
@@ -63,6 +70,14 @@ public class TestMemoryIndex extends Luc
       assertThat(e.getMessage(), containsString("frozen"));
     }
 
+    try {
+      mi.setSimilarity(new BM25Similarity(1, 1));
+      fail("Expected an IllegalArgumentException when setting the Similarity after calling freeze()");
+    }
+    catch (RuntimeException e) {
+      assertThat(e.getMessage(), containsString("frozen"));
+    }
+
     assertThat(mi.search(new TermQuery(new Term("f1", "some"))), not(is(0.0f)));
 
     mi.reset();
@@ -70,6 +85,32 @@ public class TestMemoryIndex extends Luc
     assertThat(mi.search(new TermQuery(new Term("f1", "some"))), is(0.0f));
     assertThat(mi.search(new TermQuery(new Term("f1", "wibble"))), not(is(0.0f)));
 
+    // check we can set the Similarity again
+    mi.setSimilarity(new DefaultSimilarity());
+
+  }
+
+  @Test
+  public void testSimilarities() throws IOException {
+
+    MemoryIndex mi = new MemoryIndex();
+    mi.addField("f1", "a long text field that contains many many terms", analyzer);
+
+    IndexSearcher searcher = mi.createSearcher();
+    LeafReader reader = (LeafReader) searcher.getIndexReader();
+    float n1 = reader.getNormValues("f1").get(0);
+
+    // Norms aren't cached, so we can change the Similarity
+    mi.setSimilarity(new DefaultSimilarity() {
+      @Override
+      public float lengthNorm(FieldInvertState state) {
+        return 74;
+      }
+    });
+    float n2 = reader.getNormValues("f1").get(0);
+
+    assertTrue(n1 != n2);
+
   }
 
 

Modified: lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/IndexSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/IndexSplitter.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/IndexSplitter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/IndexSplitter.java Tue Oct 28 09:19:21 2014
@@ -90,8 +90,7 @@ public class IndexSplitter {
   public IndexSplitter(Path dir) throws IOException {
     this.dir = dir;
     fsDir = FSDirectory.open(dir);
-    infos = new SegmentInfos();
-    infos.read(fsDir);
+    infos = SegmentInfos.readLatestCommit(fsDir);
   }
 
   public void listSegments() throws IOException {

Modified: lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/PKIndexSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/PKIndexSplitter.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/PKIndexSplitter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/PKIndexSplitter.java Tue Oct 28 09:19:21 2014
@@ -26,6 +26,7 @@ import org.apache.lucene.search.DocIdSet
 import org.apache.lucene.search.Filter;
 import org.apache.lucene.search.TermRangeFilter;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.util.BitSetIterator;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.FixedBitSet;
 import org.apache.lucene.util.IOUtils;
@@ -141,7 +142,7 @@ public class PKIndexSplitter {
       if (in.hasDeletions()) {
         final Bits oldLiveDocs = in.getLiveDocs();
         assert oldLiveDocs != null;
-        final DocIdSetIterator it = bits.iterator();
+        final DocIdSetIterator it = new BitSetIterator(bits, 0L); // the cost is not useful here
         for (int i = it.nextDoc(); i < maxDoc; i = it.nextDoc()) {
           if (!oldLiveDocs.get(i)) {
             // we can safely modify the current bit, as the iterator already stepped over it:

Modified: lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/sorter/BlockJoinComparatorSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/sorter/BlockJoinComparatorSource.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/sorter/BlockJoinComparatorSource.java (original)
+++ lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/sorter/BlockJoinComparatorSource.java Tue Oct 28 09:19:21 2014
@@ -30,6 +30,7 @@ import org.apache.lucene.search.ScoreDoc
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.search.Sort;
 import org.apache.lucene.search.SortField;
+import org.apache.lucene.util.BitDocIdSet;
 import org.apache.lucene.util.FixedBitSet;
 
 /**
@@ -148,10 +149,10 @@ public class BlockJoinComparatorSource e
         if (parents == null) {
           throw new IllegalStateException("LeafReader " + context.reader() + " contains no parents!");
         }
-        if (!(parents instanceof FixedBitSet)) {
+        if (!(parents instanceof BitDocIdSet)) {
           throw new IllegalStateException("parentFilter must return FixedBitSet; got " + parents);
         }
-        parentBits = (FixedBitSet) parents;
+        parentBits = (FixedBitSet) parents.bits();
         for (int i = 0; i < parentComparators.length; i++) {
           parentComparators[i] = parentComparators[i].setNextReader(context);
         }

Modified: lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingLeafReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingLeafReader.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingLeafReader.java (original)
+++ lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingLeafReader.java Tue Oct 28 09:19:21 2014
@@ -746,7 +746,7 @@ public class SortingLeafReader extends F
   /** Expert: same as {@link #wrap(org.apache.lucene.index.LeafReader, Sort)} but operates directly on a {@link Sorter.DocMap}. */
   static LeafReader wrap(LeafReader reader, Sorter.DocMap docMap) {
     if (docMap == null) {
-      // the reader is already sorter
+      // the reader is already sorted
       return reader;
     }
     if (reader.maxDoc() != docMap.size()) {

Modified: lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java Tue Oct 28 09:19:21 2014
@@ -46,18 +46,15 @@ public class TestIndexSplitter extends L
             setMergePolicy(mergePolicy)
     );
     for (int x=0; x < 100; x++) {
-      Document doc = DocHelper.createDocument(x, "index", 5);
-      iw.addDocument(doc);
+      iw.addDocument(DocHelper.createDocument(iw, x, "index", 5));
     }
     iw.commit();
     for (int x=100; x < 150; x++) {
-      Document doc = DocHelper.createDocument(x, "index2", 5);
-      iw.addDocument(doc);
+      iw.addDocument(DocHelper.createDocument(iw, x, "index2", 5));
     }
     iw.commit();
     for (int x=150; x < 200; x++) {
-      Document doc = DocHelper.createDocument(x, "index3", 5);
-      iw.addDocument(doc);
+      iw.addDocument(DocHelper.createDocument(iw, x, "index3", 5));
     }
     iw.commit();
     DirectoryReader iwReader = iw.getReader();
@@ -78,8 +75,7 @@ public class TestIndexSplitter extends L
     Path destDir2 = createTempDir(LuceneTestCase.getTestClass().getSimpleName());
     IndexSplitter.main(new String[] {dir.toAbsolutePath().toString(), destDir2.toAbsolutePath().toString(), splitSegName});
     Directory fsDirDest2 = newFSDirectory(destDir2);
-    SegmentInfos sis = new SegmentInfos();
-    sis.read(fsDirDest2);
+    SegmentInfos sis = SegmentInfos.readLatestCommit(fsDirDest2);
     assertEquals(1, sis.size());
     r = DirectoryReader.open(fsDirDest2);
     assertEquals(50, r.maxDoc());

Modified: lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/sorter/IndexSortingTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/sorter/IndexSortingTest.java?rev=1634823&r1=1634822&r2=1634823&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/sorter/IndexSortingTest.java (original)
+++ lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/sorter/IndexSortingTest.java Tue Oct 28 09:19:21 2014
@@ -22,6 +22,7 @@ import java.util.Collections;
 import java.util.List;
 
 import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.SlowCompositeReaderWrapper;
 import org.apache.lucene.search.Sort;
@@ -40,13 +41,15 @@ public class IndexSortingTest extends So
   
   @BeforeClass
   public static void beforeClassSorterUtilTest() throws Exception {
+    // NOTE: index was created by by super's @BeforeClass
+
     // only read the values of the undeleted documents, since after addIndexes,
     // the deleted ones will be dropped from the index.
-    Bits liveDocs = reader.getLiveDocs();
+    Bits liveDocs = unsortedReader.getLiveDocs();
     List<Integer> values = new ArrayList<>();
-    for (int i = 0; i < reader.maxDoc(); i++) {
+    for (int i = 0; i < unsortedReader.maxDoc(); i++) {
       if (liveDocs == null || liveDocs.get(i)) {
-        values.add(Integer.valueOf(reader.document(i).get(ID_FIELD)));
+        values.add(Integer.valueOf(unsortedReader.document(i).get(ID_FIELD)));
       }
     }
     int idx = random().nextInt(SORT.length);
@@ -68,9 +71,10 @@ public class IndexSortingTest extends So
 
     Directory target = newDirectory();
     IndexWriter writer = new IndexWriter(target, newIndexWriterConfig(null));
-    reader = SortingLeafReader.wrap(reader, sorter);
+    IndexReader reader = SortingLeafReader.wrap(unsortedReader, sorter);
     writer.addIndexes(reader);
     writer.close();
+    // NOTE: also closes unsortedReader
     reader.close();
     dir.close();
     
@@ -79,8 +83,8 @@ public class IndexSortingTest extends So
     TestUtil.checkIndex(dir);
     
     // set reader for tests
-    reader = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(dir));
-    assertFalse("index should not have deletions", reader.hasDeletions());
+    sortedReader = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(dir));
+    assertFalse("index should not have deletions", sortedReader.hasDeletions());
   }
   
 }



Mime
View raw message