lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject svn commit: r1058019 [1/2] - in /lucene/dev/trunk: lucene/ lucene/contrib/demo/src/java/org/apache/lucene/demo/ lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/ lucene/contrib/instantiated/src/test/org/apache/lucene/store/instant...
Date Wed, 12 Jan 2011 08:22:14 GMT
Author: simonw
Date: Wed Jan 12 08:22:12 2011
New Revision: 1058019

URL: http://svn.apache.org/viewvc?rev=1058019&view=rev
Log:
LUCENE-2831: Cut over Collector#setNextReader & FieldComparator#setNextReader to AtomicReaderContext

Modified:
    lucene/dev/trunk/lucene/CHANGES.txt
    lucene/dev/trunk/lucene/contrib/demo/src/java/org/apache/lucene/demo/SearchFiles.java
    lucene/dev/trunk/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java
    lucene/dev/trunk/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestRealTime.java
    lucene/dev/trunk/lucene/contrib/lucli/src/java/lucli/LuceneMethods.java
    lucene/dev/trunk/lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
    lucene/dev/trunk/lucene/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java
    lucene/dev/trunk/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java
    lucene/dev/trunk/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java
    lucene/dev/trunk/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceFieldComparatorSource.java
    lucene/dev/trunk/lucene/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java
    lucene/dev/trunk/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynExpand.java
    lucene/dev/trunk/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynLookup.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/BooleanScorer.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/Collector.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/ConstantScoreQuery.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/FieldComparator.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/IndexSearcher.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/MultiCollector.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/PositiveScoresOnlyCollector.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TimeLimitingCollector.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TopFieldCollector.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TopScoreDocCollector.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TotalHitCountCollector.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestOmitTf.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/CheckHits.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/JustCompileSearch.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/MultiCollectorTest.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/QueryUtils.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestDocBoost.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestElevationComparator.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestScorerPerf.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSetNorm.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSimilarity.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSort.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSubScorerFreqs.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTermScorer.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTopDocsCollector.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/QueryComponent.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/TermsComponent.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/schema/RandomSortField.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/search/DocSetHitCollector.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/search/Grouping.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/search/MissingStringLastComparatorSource.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ValueSource.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/update/UpdateHandler.java
    lucene/dev/trunk/solr/src/test/org/apache/solr/search/TestDocSet.java
    lucene/dev/trunk/solr/src/test/org/apache/solr/search/TestIndexSearcher.java
    lucene/dev/trunk/solr/src/test/org/apache/solr/search/TestSort.java
    lucene/dev/trunk/solr/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java

Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Wed Jan 12 08:22:12 2011
@@ -128,8 +128,8 @@ Changes in backwards compatibility polic
   ParallelMultiSearcher into IndexSearcher as an optional
   ExecutorServiced passed to its ctor.  (Mike McCandless)
 
-* LUCENE-2837: Changed Weight#scorer, Weight#explain & Filter#getDocIdSet to
-  operate on a ReaderContext instead of directly on IndexReader to enable
+* LUCENE-2831: Changed Weight#scorer, Weight#explain & Filter#getDocIdSet to
+  operate on a AtomicReaderContext instead of directly on IndexReader to enable
   searches to be aware of IndexSearcher's context. (Simon Willnauer)
   
 * LUCENE-2839: Scorer#score(Collector,int,int) is now public because it is
@@ -188,6 +188,10 @@ API Changes
 
 * LUCENE-2778: RAMDirectory now exposes newRAMFile() which allows to override
   and return a different RAMFile implementation. (Shai Erera)
+  
+* LUCENE-2831: Weight#scorer, Weight#explain, Filter#getDocIdSet,
+  Collector#setNextReader & FieldComparator#setNextReader now expect an
+  AtomicReaderContext instead of an IndexReader. (Simon Willnauer)
 
 New features
 

Modified: lucene/dev/trunk/lucene/contrib/demo/src/java/org/apache/lucene/demo/SearchFiles.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/demo/src/java/org/apache/lucene/demo/SearchFiles.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/demo/src/java/org/apache/lucene/demo/SearchFiles.java (original)
+++ lucene/dev/trunk/lucene/contrib/demo/src/java/org/apache/lucene/demo/SearchFiles.java Wed Jan 12 08:22:12 2011
@@ -28,6 +28,7 @@ import org.apache.lucene.analysis.Analyz
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.IndexSearcher;
@@ -160,9 +161,9 @@ public class SearchFiles {
       }
 
       @Override
-      public void setNextReader(IndexReader reader, int docBase)
+      public void setNextReader(AtomicReaderContext context)
           throws IOException {
-        this.docBase = docBase;
+        this.docBase = context.docBase;
       }
 
       @Override

Modified: lucene/dev/trunk/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java (original)
+++ lucene/dev/trunk/lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java Wed Jan 12 08:22:12 2011
@@ -36,6 +36,7 @@ import org.apache.lucene.index.IndexRead
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermPositionVector;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.PhraseQuery;
@@ -133,9 +134,9 @@ public class HighlighterPhraseTest exten
           }
 
           @Override
-          public void setNextReader(IndexReader indexreader, int i)
+          public void setNextReader(AtomicReaderContext context)
               throws IOException {
-            this.baseDoc = i;
+            this.baseDoc = context.docBase;
           }
 
           @Override

Modified: lucene/dev/trunk/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestRealTime.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestRealTime.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestRealTime.java (original)
+++ lucene/dev/trunk/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestRealTime.java Wed Jan 12 08:22:12 2011
@@ -20,8 +20,8 @@ import org.apache.lucene.search.TermQuer
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.Term;
-import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.util.LuceneTestCase;
 
 /**
@@ -67,7 +67,7 @@ public class TestRealTime extends Lucene
     @Override
     public void setScorer(Scorer scorer) {}
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {}
+    public void setNextReader(AtomicReaderContext context) {}
     @Override
     public boolean acceptsDocsOutOfOrder() { return true; }
     @Override

Modified: lucene/dev/trunk/lucene/contrib/lucli/src/java/lucli/LuceneMethods.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/lucli/src/java/lucli/LuceneMethods.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/lucli/src/java/lucli/LuceneMethods.java (original)
+++ lucene/dev/trunk/lucene/contrib/lucli/src/java/lucli/LuceneMethods.java Wed Jan 12 08:22:12 2011
@@ -41,6 +41,7 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Fieldable;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.Fields;
@@ -232,7 +233,7 @@ class LuceneMethods {
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {}
+    public void setNextReader(AtomicReaderContext context) {}
     @Override
     public boolean acceptsDocsOutOfOrder() {
       return true;

Modified: lucene/dev/trunk/lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java (original)
+++ lucene/dev/trunk/lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java Wed Jan 12 08:22:12 2011
@@ -38,6 +38,7 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.FieldSelector;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.Fields;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.index.FieldsEnum;
@@ -443,7 +444,7 @@ public class MemoryIndex implements Seri
         }
 
         @Override
-        public void setNextReader(IndexReader reader, int docBase) { }
+        public void setNextReader(AtomicReaderContext context) { }
       });
       float score = scores[0];
       return score;

Modified: lucene/dev/trunk/lucene/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java (original)
+++ lucene/dev/trunk/lucene/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java Wed Jan 12 08:22:12 2011
@@ -23,6 +23,7 @@ import java.util.Arrays;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.DefaultSimilarity;
 import org.apache.lucene.search.IndexSearcher;
@@ -122,7 +123,7 @@ public class TestFieldNormModifier exten
         scores[doc + docBase] = scorer.score();
       }
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {
+      public void setNextReader(AtomicReaderContext context) {
         this.docBase = docBase;
       }
       @Override
@@ -157,7 +158,7 @@ public class TestFieldNormModifier exten
         scores[doc + docBase] = scorer.score();
       }
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {
+      public void setNextReader(AtomicReaderContext context) {
         this.docBase = docBase;
       }
       @Override
@@ -209,7 +210,7 @@ public class TestFieldNormModifier exten
         scores[doc + docBase] = scorer.score();
       }
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {
+      public void setNextReader(AtomicReaderContext context) {
         this.docBase = docBase;
       }
       @Override

Modified: lucene/dev/trunk/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java (original)
+++ lucene/dev/trunk/lucene/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java Wed Jan 12 08:22:12 2011
@@ -25,6 +25,7 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.index.FieldNormModifier;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.MultiNorms;
 import org.apache.lucene.index.Term;
@@ -139,7 +140,7 @@ public class TestLengthNormModifier exte
       scores[doc + docBase] = scorer.score();
     }
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {
+    public void setNextReader(AtomicReaderContext context) {
       this.docBase = docBase;
     }
     @Override
@@ -181,7 +182,7 @@ public class TestLengthNormModifier exte
         scores[doc + docBase] = scorer.score();
       }
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {
+      public void setNextReader(AtomicReaderContext context) {
         this.docBase = docBase;
       }
       @Override

Modified: lucene/dev/trunk/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java (original)
+++ lucene/dev/trunk/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java Wed Jan 12 08:22:12 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.queryParser.su
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.Scorer;
@@ -77,7 +77,7 @@ public class BooleanQueryTst {
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase) throws IOException {
+    public void setNextReader(AtomicReaderContext context) throws IOException {
       this.docBase = docBase;
     }
     

Modified: lucene/dev/trunk/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceFieldComparatorSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceFieldComparatorSource.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceFieldComparatorSource.java (original)
+++ lucene/dev/trunk/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceFieldComparatorSource.java Wed Jan 12 08:22:12 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.spatial.tier;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.Filter;
 import org.apache.lucene.search.FieldComparator;
 import org.apache.lucene.search.FieldComparatorSource;
@@ -108,16 +108,14 @@ public class DistanceFieldComparatorSour
 
 		}
 
-		@Override
-                public FieldComparator setNextReader(IndexReader reader, int docBase)
-                  throws IOException {
-			
-			// each reader in a segmented base
-			// has an offset based on the maxDocs of previous readers
-			offset = docBase;
-
-                        return this;
-		}
+    @Override
+    public FieldComparator setNextReader(AtomicReaderContext context)
+        throws IOException {
+      // each reader in a segmented base
+      // has an offset based on the maxDocs of previous readers
+      offset = context.docBase;
+      return this;
+    }
 
 		@Override
 		public Comparable<Double> value(int slot) {

Modified: lucene/dev/trunk/lucene/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java (original)
+++ lucene/dev/trunk/lucene/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java Wed Jan 12 08:22:12 2011
@@ -32,6 +32,7 @@ import org.apache.lucene.document.Fielda
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.queryParser.MultiFieldQueryParser;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.IndexSearcher;
@@ -192,7 +193,7 @@ public class ListSearcher extends Abstra
       }
 
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {}
+      public void setNextReader(AtomicReaderContext context) {}
       @Override
       public boolean acceptsDocsOutOfOrder() {
         return true;

Modified: lucene/dev/trunk/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynExpand.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynExpand.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynExpand.java (original)
+++ lucene/dev/trunk/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynExpand.java Wed Jan 12 08:22:12 2011
@@ -33,6 +33,7 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.Term;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.Collector;
@@ -160,9 +161,9 @@ public final class SynExpand {
         }
 
         @Override
-        public void setNextReader(IndexReader reader, int docBase)
+        public void setNextReader(AtomicReaderContext context)
             throws IOException {
-          this.reader = reader;
+          this.reader = context.reader;
         }
 
         @Override

Modified: lucene/dev/trunk/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynLookup.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynLookup.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynLookup.java (original)
+++ lucene/dev/trunk/lucene/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynLookup.java Wed Jan 12 08:22:12 2011
@@ -32,6 +32,7 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.Term;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.Collector;
@@ -59,7 +60,7 @@ public class SynLookup {
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {}
+    public void setNextReader(AtomicReaderContext context) {}
     @Override
     public boolean acceptsDocsOutOfOrder() {
       return true;
@@ -169,9 +170,9 @@ public class SynLookup {
         }
 
         @Override
-        public void setNextReader(IndexReader reader, int docBase)
+        public void setNextReader(AtomicReaderContext context)
             throws IOException {
-          this.reader = reader;
+          this.reader = context.reader;
         }
 
         @Override

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/BooleanScorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/BooleanScorer.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/BooleanScorer.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/BooleanScorer.java Wed Jan 12 08:22:12 2011
@@ -20,7 +20,7 @@ package org.apache.lucene.search;
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.BooleanClause.Occur;
 
 /* Description from Doug Cutting (excerpted from
@@ -92,7 +92,7 @@ final class BooleanScorer extends Scorer
     }
     
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {
+    public void setNextReader(AtomicReaderContext context) {
       // not needed by this implementation
     }
     

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/Collector.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/Collector.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/Collector.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/Collector.java Wed Jan 12 08:22:12 2011
@@ -19,7 +19,8 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
+import org.apache.lucene.index.IndexReader.ReaderContext;
 
 /**
  * <p>Expert: Collectors are primarily meant to be used to
@@ -98,8 +99,8 @@ import org.apache.lucene.index.IndexRead
  *     bits.set(doc + docBase);
  *   }
  * 
- *   public void setNextReader(IndexReader reader, int docBase) {
- *     this.docBase = docBase;
+ *   public void setNextReader(AtomicReaderContext context) {
+ *     this.docBase = context.docBase;
  *   }
  * });
  * </pre>
@@ -143,17 +144,16 @@ public abstract class Collector {
   public abstract void collect(int doc) throws IOException;
 
   /**
-   * Called before collecting from each IndexReader. All doc ids in
-   * {@link #collect(int)} will correspond to reader.
+   * Called before collecting from each {@link AtomicReaderContext}. All doc ids in
+   * {@link #collect(int)} will correspond to {@link ReaderContext#reader}.
    * 
-   * Add docBase to the current IndexReaders internal document id to re-base ids
-   * in {@link #collect(int)}.
+   * Add {@link AtomicReaderContext#docBase} to the current  {@link ReaderContext#reader}'s
+   * internal document id to re-base ids in {@link #collect(int)}.
    * 
-   * @param reader
-   *          next IndexReader
-   * @param docBase
+   * @param context
+   *          next atomic reader context
    */
-  public abstract void setNextReader(IndexReader reader, int docBase) throws IOException;
+  public abstract void setNextReader(AtomicReaderContext context) throws IOException;
 
   /**
    * Return <code>true</code> if this collector does not

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/ConstantScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/ConstantScoreQuery.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/ConstantScoreQuery.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/ConstantScoreQuery.java Wed Jan 12 08:22:12 2011
@@ -222,8 +222,8 @@ public class ConstantScoreQuery extends 
         }
         
         @Override
-        public void setNextReader(IndexReader reader, int docBase) throws IOException {
-          collector.setNextReader(reader, docBase);
+        public void setNextReader(AtomicReaderContext context) throws IOException {
+          collector.setNextReader(context);
         }
         
         @Override

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/FieldComparator.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/FieldComparator.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/FieldComparator.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/FieldComparator.java Wed Jan 12 08:22:12 2011
@@ -21,7 +21,7 @@ import java.io.IOException;
 import java.text.Collator;
 import java.util.Locale;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.FieldCache.DocTermsIndex;
 import org.apache.lucene.search.FieldCache.DocTerms;
 import org.apache.lucene.search.cache.ByteValuesCreator;
@@ -82,7 +82,7 @@ import org.apache.lucene.util.packed.Pac
  *       priority queue.  The {@link FieldValueHitQueue}
  *       calls this method when a new hit is competitive.
  *
- *  <li> {@link #setNextReader} Invoked
+ *  <li> {@link #setNextReader(AtomicReaderContext)} Invoked
  *       when the search is switching to the next segment.
  *       You may need to update internal state of the
  *       comparator, for example retrieving new values from
@@ -150,19 +150,18 @@ public abstract class FieldComparator {
   public abstract void copy(int slot, int doc) throws IOException;
 
   /**
-   * Set a new Reader. All subsequent docIDs are relative to
+   * Set a new {@link AtomicReaderContext}. All subsequent docIDs are relative to
    * the current reader (you must add docBase if you need to
    * map it to a top-level docID).
    * 
-   * @param reader current reader
-   * @param docBase docBase of this reader 
+   * @param context current reader context
    * @return the comparator to use for this segment; most
    *   comparators can just return "this" to reuse the same
    *   comparator across segments
    * @throws IOException
    * @throws IOException
    */
-  public abstract FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException;
+  public abstract FieldComparator setNextReader(AtomicReaderContext context) throws IOException;
 
   /** Sets the Scorer to use in case a document's score is
    *  needed.
@@ -242,8 +241,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      setup(FieldCache.DEFAULT.getBytes(reader, creator.field, creator));
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      setup(FieldCache.DEFAULT.getBytes(context.reader, creator.field, creator));
       docValues = cached.values;
       return this;
     }
@@ -314,8 +313,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      setup(FieldCache.DEFAULT.getDoubles(reader, creator.field, creator));
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      setup(FieldCache.DEFAULT.getDoubles(context.reader, creator.field, creator));
       docValues = cached.values;
       return this;
     }
@@ -388,8 +387,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      setup(FieldCache.DEFAULT.getFloats(reader, creator.field, creator));
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      setup(FieldCache.DEFAULT.getFloats(context.reader, creator.field, creator));
       docValues = cached.values;
       return this;
     }
@@ -444,8 +443,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      setup( FieldCache.DEFAULT.getShorts(reader, creator.field, creator));
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      setup( FieldCache.DEFAULT.getShorts(context.reader, creator.field, creator));
       docValues = cached.values;
       return this;
     }
@@ -522,8 +521,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      setup(FieldCache.DEFAULT.getInts(reader, creator.field, creator));
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      setup(FieldCache.DEFAULT.getInts(context.reader, creator.field, creator));
       docValues = cached.values;
       return this;
     }
@@ -597,8 +596,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      setup(FieldCache.DEFAULT.getLongs(reader, creator.field, creator));
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      setup(FieldCache.DEFAULT.getLongs(context.reader, creator.field, creator));
       docValues = cached.values;
       return this;
     }
@@ -648,7 +647,7 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) {
+    public FieldComparator setNextReader(AtomicReaderContext context) {
       return this;
     }
     
@@ -700,11 +699,11 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) {
+    public FieldComparator setNextReader(AtomicReaderContext context) {
       // TODO: can we "map" our docIDs to the current
       // reader? saves having to then subtract on every
       // compare call
-      this.docBase = docBase;
+      this.docBase = context.docBase;
       return this;
     }
     
@@ -781,8 +780,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      currentDocTerms = FieldCache.DEFAULT.getTerms(reader, field);
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      currentDocTerms = FieldCache.DEFAULT.getTerms(context.reader, field);
       return this;
     }
     
@@ -876,8 +875,8 @@ public abstract class FieldComparator {
     abstract class PerSegmentComparator extends FieldComparator {
       
       @Override
-      public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-        return TermOrdValComparator.this.setNextReader(reader, docBase);
+      public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+        return TermOrdValComparator.this.setNextReader(context);
       }
 
       @Override
@@ -1142,8 +1141,9 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      termsIndex = FieldCache.DEFAULT.getTermsIndex(reader, field);
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      final int docBase = context.docBase;
+      termsIndex = FieldCache.DEFAULT.getTermsIndex(context.reader, field);
       final PackedInts.Reader docToOrd = termsIndex.getDocToOrd();
       FieldComparator perSegComp;
       if (docToOrd instanceof Direct8) {
@@ -1257,8 +1257,8 @@ public abstract class FieldComparator {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      docTerms = FieldCache.DEFAULT.getTerms(reader, field);
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      docTerms = FieldCache.DEFAULT.getTerms(context.reader, field);
       return this;
     }
     

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/IndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/IndexSearcher.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/IndexSearcher.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/IndexSearcher.java Wed Jan 12 08:22:12 2011
@@ -486,7 +486,7 @@ public class IndexSearcher {
     // always use single thread:
     if (filter == null) {
       for (int i = 0; i < leafContexts.length; i++) { // search each subreader
-        collector.setNextReader(leafContexts[i].reader, leafContexts[i].docBase);
+        collector.setNextReader(leafContexts[i]);
         Scorer scorer = weight.scorer(leafContexts[i], !collector.acceptsDocsOutOfOrder(), true);
         if (scorer != null) {
           scorer.score(collector);
@@ -494,7 +494,7 @@ public class IndexSearcher {
       }
     } else {
       for (int i = 0; i < leafContexts.length; i++) { // search each subreader
-        collector.setNextReader(leafContexts[i].reader, leafContexts[i].docBase);
+        collector.setNextReader(leafContexts[i]);
         searchWithFilter(leafContexts[i], weight, filter, collector);
       }
     }

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/MultiCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/MultiCollector.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/MultiCollector.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/MultiCollector.java Wed Jan 12 08:22:12 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.Scorer;
 
@@ -108,9 +108,9 @@ public class MultiCollector extends Coll
   }
 
   @Override
-  public void setNextReader(IndexReader reader, int o) throws IOException {
+  public void setNextReader(AtomicReaderContext context) throws IOException {
     for (Collector c : collectors) {
-      c.setNextReader(reader, o);
+      c.setNextReader(context);
     }
   }
 

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/PositiveScoresOnlyCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/PositiveScoresOnlyCollector.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/PositiveScoresOnlyCollector.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/PositiveScoresOnlyCollector.java Wed Jan 12 08:22:12 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 
 /**
  * A {@link Collector} implementation which wraps another
@@ -43,8 +43,8 @@ public class PositiveScoresOnlyCollector
   }
 
   @Override
-  public void setNextReader(IndexReader reader, int docBase) throws IOException {
-    c.setNextReader(reader, docBase);
+  public void setNextReader(AtomicReaderContext context) throws IOException {
+    c.setNextReader(context);
   }
 
   @Override

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TimeLimitingCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TimeLimitingCollector.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TimeLimitingCollector.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TimeLimitingCollector.java Wed Jan 12 08:22:12 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.util.ThreadInterruptedException;
 
 /**
@@ -213,9 +213,9 @@ public class TimeLimitingCollector exten
   }
   
   @Override
-  public void setNextReader(IndexReader reader, int base) throws IOException {
-    collector.setNextReader(reader, base);
-    this.docBase = base;
+  public void setNextReader(AtomicReaderContext context) throws IOException {
+    collector.setNextReader(context);
+    this.docBase = context.docBase;
   }
   
   @Override

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TopFieldCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TopFieldCollector.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TopFieldCollector.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TopFieldCollector.java Wed Jan 12 08:22:12 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.FieldValueHitQueue.Entry;
 import org.apache.lucene.util.PriorityQueue;
 
@@ -92,9 +92,9 @@ public abstract class TopFieldCollector 
     }
     
     @Override
-    public void setNextReader(IndexReader reader, int docBase) throws IOException {
-      this.docBase = docBase;
-      queue.setComparator(0, comparator.setNextReader(reader, docBase));
+    public void setNextReader(AtomicReaderContext context) throws IOException {
+      this.docBase = context.docBase;
+      queue.setComparator(0, comparator.setNextReader(context));
       comparator = queue.firstComparator;
     }
     
@@ -447,10 +447,10 @@ public abstract class TopFieldCollector 
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase) throws IOException {
-      this.docBase = docBase;
+    public void setNextReader(AtomicReaderContext context) throws IOException {
+      this.docBase = context.docBase;
       for (int i = 0; i < comparators.length; i++) {
-        queue.setComparator(i, comparators[i].setNextReader(reader, docBase));
+        queue.setComparator(i, comparators[i].setNextReader(context));
       }
     }
 

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TopScoreDocCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TopScoreDocCollector.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TopScoreDocCollector.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TopScoreDocCollector.java Wed Jan 12 08:22:12 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 
 /**
  * A {@link Collector} implementation that collects the top-scoring hits,
@@ -155,8 +155,8 @@ public abstract class TopScoreDocCollect
   }
   
   @Override
-  public void setNextReader(IndexReader reader, int base) {
-    docBase = base;
+  public void setNextReader(AtomicReaderContext context) {
+    docBase = context.docBase;
   }
   
   @Override

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TotalHitCountCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TotalHitCountCollector.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TotalHitCountCollector.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/TotalHitCountCollector.java Wed Jan 12 08:22:12 2011
@@ -17,7 +17,7 @@ package org.apache.lucene.search;
  * limitations under the License.
  */
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 
 /**
  * Just counts the total number of hits.
@@ -38,7 +38,7 @@ public class TotalHitCountCollector exte
     totalHits++;
   }
 
-  public void setNextReader(IndexReader reader, int docBase) {
+  public void setNextReader(AtomicReaderContext context) {
   }
 
   public boolean acceptsDocsOutOfOrder() {

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestOmitTf.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestOmitTf.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestOmitTf.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestOmitTf.java Wed Jan 12 08:22:12 2011
@@ -26,6 +26,7 @@ import org.apache.lucene.analysis.Analyz
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.*;
 import org.apache.lucene.search.BooleanClause.Occur;
 import org.apache.lucene.store.Directory;
@@ -414,7 +415,7 @@ public class TestOmitTf extends LuceneTe
     public static int getSum() { return sum; }
     
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {
+    public void setNextReader(AtomicReaderContext context) {
       this.docBase = docBase;
     }
     @Override

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/CheckHits.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/CheckHits.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/CheckHits.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/CheckHits.java Wed Jan 12 08:22:12 2011
@@ -25,6 +25,7 @@ import java.util.Random;
 import junit.framework.Assert;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.store.Directory;
 
 public class CheckHits {
@@ -120,8 +121,8 @@ public class CheckHits {
       bag.add(Integer.valueOf(doc + base));
     }
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {
-      base = docBase;
+    public void setNextReader(AtomicReaderContext context) {
+      base = context.docBase;
     }
     @Override
     public boolean acceptsDocsOutOfOrder() {
@@ -483,8 +484,8 @@ public class CheckHits {
       verifyExplanation(d,doc,scorer.score(),deep,exp);
     }
     @Override
-    public void setNextReader(IndexReader reader, int docBase) {
-      base = docBase;
+    public void setNextReader(AtomicReaderContext context) {
+      base = context.docBase;
     }
     @Override
     public boolean acceptsDocsOutOfOrder() {

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/JustCompileSearch.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/JustCompileSearch.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/JustCompileSearch.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/JustCompileSearch.java Wed Jan 12 08:22:12 2011
@@ -44,7 +44,7 @@ final class JustCompileSearch {
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase)
+    public void setNextReader(AtomicReaderContext context)
         throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
@@ -127,7 +127,7 @@ final class JustCompileSearch {
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase)
+    public FieldComparator setNextReader(AtomicReaderContext context)
         throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
@@ -300,7 +300,7 @@ final class JustCompileSearch {
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase)
+    public void setNextReader(AtomicReaderContext context)
         throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/MultiCollectorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/MultiCollectorTest.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/MultiCollectorTest.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/MultiCollectorTest.java Wed Jan 12 08:22:12 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.util.LuceneTestCase;
@@ -46,7 +46,7 @@ public class MultiCollectorTest extends 
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase) throws IOException {
+    public void setNextReader(AtomicReaderContext context) throws IOException {
       setNextReaderCalled = true;
     }
 
@@ -73,7 +73,7 @@ public class MultiCollectorTest extends 
     assertTrue(c instanceof MultiCollector);
     assertTrue(c.acceptsDocsOutOfOrder());
     c.collect(1);
-    c.setNextReader(null, 0);
+    c.setNextReader(null);
     c.setScorer(null);
   }
 
@@ -95,7 +95,7 @@ public class MultiCollectorTest extends 
     Collector c = MultiCollector.wrap(dcs);
     assertTrue(c.acceptsDocsOutOfOrder());
     c.collect(1);
-    c.setNextReader(null, 0);
+    c.setNextReader(null);
     c.setScorer(null);
 
     for (DummyCollector dc : dcs) {

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/QueryUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/QueryUtils.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/QueryUtils.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/QueryUtils.java Wed Jan 12 08:22:12 2011
@@ -220,7 +220,7 @@ public class QueryUtils {
    */
   public static void checkSkipTo(final Query q, final IndexSearcher s) throws IOException {
     //System.out.println("Checking "+q);
-    final AtomicReaderContext[] context = ReaderUtil.leaves(s.getTopReaderContext());
+    final AtomicReaderContext[] readerContextArray = ReaderUtil.leaves(s.getTopReaderContext());
     if (q.weight(s).scoresDocsOutOfOrder()) return;  // in this case order of skipTo() might differ from that of next().
 
     final int skip_op = 0;
@@ -265,7 +265,7 @@ public class QueryUtils {
             try {
               if (scorer == null) {
                 Weight w = q.weight(s);
-                scorer = w.scorer(context[leafPtr], true, false);
+                scorer = w.scorer(readerContextArray[leafPtr], true, false);
               }
               
               int op = order[(opidx[0]++) % order.length];
@@ -303,7 +303,7 @@ public class QueryUtils {
           }
 
           @Override
-          public void setNextReader(IndexReader reader, int docBase) throws IOException {
+          public void setNextReader(AtomicReaderContext context) throws IOException {
             // confirm that skipping beyond the last doc, on the
             // previous reader, hits NO_MORE_DOCS
             if (lastReader[0] != null) {
@@ -317,8 +317,8 @@ public class QueryUtils {
               }
               leafPtr++;
             }
-            lastReader[0] = reader;
-            assert context[leafPtr].reader == reader;
+            lastReader[0] = context.reader;
+            assert readerContextArray[leafPtr].reader == context.reader;
             this.scorer = null;
             lastDoc[0] = -1;
           }
@@ -385,7 +385,7 @@ public class QueryUtils {
       }
 
       @Override
-      public void setNextReader(IndexReader reader, int docBase) throws IOException {
+      public void setNextReader(AtomicReaderContext context) throws IOException {
         // confirm that skipping beyond the last doc, on the
         // previous reader, hits NO_MORE_DOCS
         if (lastReader[0] != null) {
@@ -400,7 +400,7 @@ public class QueryUtils {
           leafPtr++;
         }
 
-        lastReader[0] = reader;
+        lastReader[0] = context.reader;
         lastDoc[0] = -1;
       }
       @Override

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java Wed Jan 12 08:22:12 2011
@@ -20,6 +20,7 @@ package org.apache.lucene.search;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
@@ -68,7 +69,7 @@ public class TestConstantScoreQuery exte
       }
       
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {
+      public void setNextReader(AtomicReaderContext context) {
       }
       
       @Override

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestDocBoost.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestDocBoost.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestDocBoost.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestDocBoost.java Wed Jan 12 08:22:12 2011
@@ -22,6 +22,7 @@ import java.io.IOException;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.document.*;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
@@ -77,8 +78,8 @@ public class TestDocBoost extends Lucene
            scores[doc + base] = scorer.score();
          }
          @Override
-         public void setNextReader(IndexReader reader, int docBase) {
-           base = docBase;
+         public void setNextReader(AtomicReaderContext context) {
+           base = context.docBase;
          }
          @Override
          public boolean acceptsDocsOutOfOrder() {

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestElevationComparator.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestElevationComparator.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestElevationComparator.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestElevationComparator.java Wed Jan 12 08:22:12 2011
@@ -21,6 +21,7 @@ import org.apache.lucene.analysis.MockAn
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.*;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.FieldValueHitQueue.Entry;
 import org.apache.lucene.store.*;
 import org.apache.lucene.util.LuceneTestCase;
@@ -177,8 +178,8 @@ class ElevationComparatorSource extends 
      }
 
      @Override
-     public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-       idIndex = FieldCache.DEFAULT.getTermsIndex(reader, fieldname);
+     public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+       idIndex = FieldCache.DEFAULT.getTermsIndex(context.reader, fieldname);
        return this;
      }
 

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java Wed Jan 12 08:22:12 2011
@@ -22,6 +22,7 @@ import org.apache.lucene.analysis.MockTo
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
@@ -197,8 +198,8 @@ public class TestMultiTermConstantScore 
         assertEquals("score for doc " + (doc + base) + " was not correct", 1.0f, scorer.score());
       }
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {
-        base = docBase;
+      public void setNextReader(AtomicReaderContext context) {
+        base = context.docBase;
       }
       @Override
       public boolean acceptsDocsOutOfOrder() {

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java Wed Jan 12 08:22:12 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.util.LuceneTestCase;
 
 public class TestScoreCachingWrappingScorer extends LuceneTestCase {
@@ -76,7 +76,7 @@ public class TestScoreCachingWrappingSco
       ++idx;
     }
 
-    @Override public void setNextReader(IndexReader reader, int docBase)
+    @Override public void setNextReader(AtomicReaderContext context)
         throws IOException {
     }
 

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestScorerPerf.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestScorerPerf.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestScorerPerf.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestScorerPerf.java Wed Jan 12 08:22:12 2011
@@ -6,7 +6,6 @@ import org.apache.lucene.util.LuceneTest
 import java.util.BitSet;
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.Term;
@@ -110,8 +109,8 @@ public class TestScorerPerf extends Luce
     public int getSum() { return sum; }
 
     @Override
-    public void setNextReader(IndexReader reader, int base) {
-      docBase = base;
+    public void setNextReader(AtomicReaderContext context) {
+      docBase = context.docBase;
     }
     @Override
     public boolean acceptsDocsOutOfOrder() {

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSetNorm.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSetNorm.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSetNorm.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSetNorm.java Wed Jan 12 08:22:12 2011
@@ -23,6 +23,7 @@ import org.apache.lucene.util.LuceneTest
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.*;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
@@ -74,8 +75,8 @@ public class TestSetNorm extends LuceneT
            scores[doc + base] = scorer.score();
          }
          @Override
-         public void setNextReader(IndexReader reader, int docBase) {
-           base = docBase;
+         public void setNextReader(AtomicReaderContext context) {
+           base = context.docBase;
          }
          @Override
          public boolean acceptsDocsOutOfOrder() {

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSimilarity.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSimilarity.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSimilarity.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSimilarity.java Wed Jan 12 08:22:12 2011
@@ -23,6 +23,7 @@ import java.util.Collection;
 
 import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
@@ -94,7 +95,7 @@ public class TestSimilarity extends Luce
            assertEquals(1.0f, scorer.score());
          }
          @Override
-        public void setNextReader(IndexReader reader, int docBase) {}
+        public void setNextReader(AtomicReaderContext context) {}
          @Override
         public boolean acceptsDocsOutOfOrder() {
            return true;
@@ -118,8 +119,8 @@ public class TestSimilarity extends Luce
            assertEquals((float)doc+base+1, scorer.score());
          }
          @Override
-        public void setNextReader(IndexReader reader, int docBase) {
-           base = docBase;
+        public void setNextReader(AtomicReaderContext context) {
+           base = context.docBase;
          }
          @Override
         public boolean acceptsDocsOutOfOrder() {
@@ -144,7 +145,7 @@ public class TestSimilarity extends Luce
            assertEquals(1.0f, scorer.score());
          }
          @Override
-         public void setNextReader(IndexReader reader, int docBase) {}
+         public void setNextReader(AtomicReaderContext context) {}
          @Override
          public boolean acceptsDocsOutOfOrder() {
            return true;
@@ -165,7 +166,7 @@ public class TestSimilarity extends Luce
         assertEquals(2.0f, scorer.score());
       }
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {}
+      public void setNextReader(AtomicReaderContext context) {}
       @Override
       public boolean acceptsDocsOutOfOrder() {
         return true;

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSort.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSort.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSort.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSort.java Wed Jan 12 08:22:12 2011
@@ -506,8 +506,8 @@ public class TestSort extends LuceneTest
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      docValues = FieldCache.DEFAULT.getInts(reader, "parser", new FieldCache.IntParser() {
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      docValues = FieldCache.DEFAULT.getInts(context.reader, "parser", new FieldCache.IntParser() {
           public final int parseInt(final BytesRef term) {
             return (term.bytes[term.offset]-'A') * 123456;
           }

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSubScorerFreqs.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSubScorerFreqs.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSubScorerFreqs.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestSubScorerFreqs.java Wed Jan 12 08:22:12 2011
@@ -19,6 +19,7 @@ package org.apache.lucene.search;
 
 import org.apache.lucene.document.*;
 import org.apache.lucene.index.*;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.util.*;
 import org.apache.lucene.search.BooleanClause.Occur;
 import org.apache.lucene.search.Scorer.ScorerVisitor;
@@ -126,10 +127,10 @@ public class TestSubScorerFreqs extends 
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase)
+    public void setNextReader(AtomicReaderContext context)
         throws IOException {
       this.docBase = docBase;
-      other.setNextReader(reader, docBase);
+      other.setNextReader(context);
     }
 
     @Override

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTermScorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTermScorer.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTermScorer.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTermScorer.java Wed Jan 12 08:22:12 2011
@@ -98,8 +98,8 @@ public class TestTermScorer extends Luce
       }
       
       @Override
-      public void setNextReader(IndexReader reader, int docBase) {
-        base = docBase;
+      public void setNextReader(AtomicReaderContext context) {
+        base = context.docBase;
       }
       
       @Override

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java Wed Jan 12 08:22:12 2011
@@ -24,6 +24,7 @@ import org.apache.lucene.analysis.MockAn
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.search.TimeLimitingCollector.TimeExceededException;
@@ -339,8 +340,8 @@ public class TestTimeLimitingCollector e
     }
     
     @Override
-    public void setNextReader(IndexReader reader, int base) {
-      docBase = base;
+    public void setNextReader(AtomicReaderContext context) {
+      docBase = context.docBase;
     }
     
     @Override

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTopDocsCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTopDocsCollector.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTopDocsCollector.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestTopDocsCollector.java Wed Jan 12 08:22:12 2011
@@ -21,6 +21,7 @@ import java.io.IOException;
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
@@ -60,9 +61,9 @@ public class TestTopDocsCollector extend
     }
 
     @Override
-    public void setNextReader(IndexReader reader, int docBase)
+    public void setNextReader(AtomicReaderContext context)
         throws IOException {
-      base = docBase;
+      base = context.docBase;
     }
 
     @Override

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/QueryComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/QueryComponent.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/QueryComponent.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/QueryComponent.java Wed Jan 12 08:22:12 2011
@@ -18,10 +18,13 @@
 package org.apache.solr.handler.component;
 
 import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
+import org.apache.lucene.index.IndexReader.ReaderContext;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.queryParser.ParseException;
 import org.apache.lucene.search.*;
 import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.ReaderUtil;
 import org.apache.solr.cloud.CloudDescriptor;
 import org.apache.solr.cloud.ZkController;
 import org.apache.solr.common.SolrDocument;
@@ -444,23 +447,21 @@ public class QueryComponent extends Sear
       SortField[] sortFields = sort==null ? new SortField[]{SortField.FIELD_SCORE} : sort.getSort();
       NamedList sortVals = new NamedList(); // order is important for the sort fields
       Field field = new Field("dummy", "", Field.Store.YES, Field.Index.NO); // a dummy Field
-
-      SolrIndexReader reader = searcher.getReader();
-      SolrIndexReader[] readers = reader.getLeafReaders();
-      SolrIndexReader subReader = reader;
-      if (readers.length==1) {
+      ReaderContext topReaderContext = searcher.getTopReaderContext();
+      AtomicReaderContext[] leaves = ReaderUtil.leaves(topReaderContext);
+      AtomicReaderContext currentLeaf = null;
+      if (leaves.length==1) {
         // if there is a single segment, use that subReader and avoid looking up each time
-        subReader = readers[0];
-        readers=null;
+        currentLeaf = leaves[0];
+        leaves=null;
       }
-      int[] offsets = reader.getLeafOffsets();
 
       for (SortField sortField: sortFields) {
         int type = sortField.getType();
         if (type==SortField.SCORE || type==SortField.DOC) continue;
 
         FieldComparator comparator = null;
-        FieldComparator comparators[] = (readers==null) ? null : new FieldComparator[readers.length];
+        FieldComparator comparators[] = (leaves==null) ? null : new FieldComparator[leaves.length];
 
         String fieldname = sortField.getField();
         FieldType ft = fieldname==null ? null : req.getSchema().getFieldTypeNoEx(fieldname);
@@ -469,26 +470,24 @@ public class QueryComponent extends Sear
         ArrayList<Object> vals = new ArrayList<Object>(docList.size());
         DocIterator it = rb.getResults().docList.iterator();
 
-        int offset = 0;
         int idx = 0;
 
         while(it.hasNext()) {
           int doc = it.nextDoc();
-          if (readers != null) {
-            idx = SolrIndexReader.readerIndex(doc, offsets);
-            subReader = readers[idx];
-            offset = offsets[idx];
+          if (leaves != null) {
+            idx = ReaderUtil.subIndex(doc, leaves);
+            currentLeaf = leaves[idx];
             comparator = comparators[idx];
           }
 
           if (comparator == null) {
             comparator = sortField.getComparator(1,0);
-            comparator = comparator.setNextReader(subReader, offset);
+            comparator = comparator.setNextReader(currentLeaf);
             if (comparators != null)
               comparators[idx] = comparator;
           }
 
-          doc -= offset;  // adjust for what segment this is in
+          doc -= currentLeaf.docBase;  // adjust for what segment this is in
           comparator.copy(0, doc);
           Object val = comparator.value(0);
 

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/QueryElevationComponent.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/QueryElevationComponent.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/QueryElevationComponent.java Wed Jan 12 08:22:12 2011
@@ -43,6 +43,7 @@ import org.apache.lucene.analysis.Analyz
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.*;
 import org.apache.lucene.util.StringHelper;
@@ -503,8 +504,8 @@ class ElevationComparatorSource extends 
         values[slot] = docVal(doc);
       }
 
-      public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-        idIndex = FieldCache.DEFAULT.getTermsIndex(reader, fieldname);
+      public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+        idIndex = FieldCache.DEFAULT.getTermsIndex(context.reader, fieldname);
         return this;
       }
 

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/TermsComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/TermsComponent.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/TermsComponent.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/TermsComponent.java Wed Jan 12 08:22:12 2011
@@ -27,7 +27,6 @@ import org.apache.solr.common.util.StrUt
 import org.apache.solr.schema.FieldType;
 import org.apache.solr.schema.StrField;
 import org.apache.solr.request.SimpleFacets.CountPair;
-import org.apache.solr.search.SolrIndexReader;
 import org.apache.solr.util.BoundedTreeSet;
 
 import org.apache.solr.client.solrj.response.TermsResponse;
@@ -103,8 +102,8 @@ public class TermsComponent extends Sear
     boolean raw = params.getBool(TermsParams.TERMS_RAW, false);
 
 
-    SolrIndexReader sr = rb.req.getSearcher().getReader();
-    Fields lfields = MultiFields.getFields(sr);
+    final IndexReader indexReader = rb.req.getSearcher().getTopReaderContext().reader;
+    Fields lfields = MultiFields.getFields(indexReader);
 
     for (String field : fields) {
       NamedList<Integer> fieldTerms = new NamedList<Integer>();

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/schema/RandomSortField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/schema/RandomSortField.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/schema/RandomSortField.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/schema/RandomSortField.java Wed Jan 12 08:22:12 2011
@@ -22,6 +22,7 @@ import java.util.Map;
 
 import org.apache.lucene.document.Fieldable;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.*;
 import org.apache.solr.response.TextResponseWriter;
 import org.apache.solr.search.QParser;
@@ -89,7 +90,7 @@ public class RandomSortField extends Fie
     // we use the top-level reader.
     return fieldName.hashCode() + base + (int)top.getVersion();
   }
-
+  
   @Override
   public SortField getSortField(SchemaField field, boolean reverse) {
     return new SortField(field.getName(), randomComparatorSource, reverse);
@@ -127,8 +128,8 @@ public class RandomSortField extends Fie
           values[slot] = hash(doc+seed);
         }
 
-        public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-          seed = getSeed(fieldname, reader);
+        public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+          seed = getSeed(fieldname, context.reader);
           return this;
         }
 

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/DocSetHitCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/DocSetHitCollector.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/DocSetHitCollector.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/DocSetHitCollector.java Wed Jan 12 08:22:12 2011
@@ -20,7 +20,7 @@ package org.apache.solr.search;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.util.OpenBitSet;
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 
 import java.io.IOException;
 
@@ -80,8 +80,8 @@ class DocSetCollector extends Collector 
   public void setScorer(Scorer scorer) throws IOException {
   }
 
-  public void setNextReader(IndexReader reader, int docBase) throws IOException {
-    this.base = docBase;
+  public void setNextReader(AtomicReaderContext context) throws IOException {
+    this.base = context.docBase;
   }
 
   public boolean acceptsDocsOutOfOrder() {
@@ -135,8 +135,8 @@ class DocSetDelegateCollector extends Do
     collector.setScorer(scorer);
   }
 
-  public void setNextReader(IndexReader reader, int docBase) throws IOException {
-    collector.setNextReader(reader, docBase);
-    this.base = docBase;
+  public void setNextReader(AtomicReaderContext context) throws IOException {
+    collector.setNextReader(context);
+    this.base = context.docBase;
   }
 }

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/Grouping.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/Grouping.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/Grouping.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/Grouping.java Wed Jan 12 08:22:12 2011
@@ -17,7 +17,7 @@
 
 package org.apache.solr.search;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.*;
 import org.apache.lucene.util.BytesRef;
 import org.apache.solr.common.util.NamedList;
@@ -457,14 +457,15 @@ class FilterCollector extends GroupColle
   @Override
   public void collect(int doc) throws IOException {
     matches++;
-    if (filter.exists(doc + docBase))
+    if (filter.exists(doc + docBase)) {
       collector.collect(doc);
+    }
   }
 
   @Override
-  public void setNextReader(IndexReader reader, int docBase) throws IOException {
-    this.docBase = docBase;
-    collector.setNextReader(reader, docBase);
+  public void setNextReader(AtomicReaderContext context) throws IOException {
+    docBase = context.docBase;
+    collector.setNextReader(context);
   }
 
   @Override
@@ -685,13 +686,13 @@ class TopGroupCollector extends GroupCol
   }
 
   @Override
-  public void setNextReader(IndexReader reader, int docBase) throws IOException {
-    this.docBase = docBase;
-    docValues = vs.getValues(context, reader);
+  public void setNextReader(AtomicReaderContext readerContext) throws IOException {
+    this.docBase = readerContext.docBase;
+    docValues = vs.getValues(context, readerContext.reader);
     filler = docValues.getValueFiller();
     mval = filler.getValue();
     for (int i=0; i<comparators.length; i++)
-      comparators[i] = comparators[i].setNextReader(reader, docBase);
+      comparators[i] = comparators[i].setNextReader(readerContext);
   }
 
   @Override
@@ -759,13 +760,13 @@ class Phase2GroupCollector extends Colle
   }
 
   @Override
-  public void setNextReader(IndexReader reader, int docBase) throws IOException {
-    this.docBase = docBase;
-    docValues = vs.getValues(context, reader);
+  public void setNextReader(AtomicReaderContext readerContext) throws IOException {
+    this.docBase = readerContext.docBase;
+    docValues = vs.getValues(context, readerContext.reader);
     filler = docValues.getValueFiller();
     mval = filler.getValue();
     for (SearchGroupDocs group : groupMap.values())
-      group.collector.setNextReader(reader, docBase);
+      group.collector.setNextReader(readerContext);
   }
 
   @Override
@@ -812,8 +813,8 @@ class Phase2StringGroupCollector extends
   }
 
   @Override
-  public void setNextReader(IndexReader reader, int docBase) throws IOException {
-    super.setNextReader(reader, docBase);
+  public void setNextReader(AtomicReaderContext context) throws IOException {
+    super.setNextReader(context);
     index = ((StringIndexDocValues)docValues).getDocTermsIndex();
 
     ordSet.clear();

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/MissingStringLastComparatorSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/MissingStringLastComparatorSource.java?rev=1058019&r1=1058018&r2=1058019&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/MissingStringLastComparatorSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/MissingStringLastComparatorSource.java Wed Jan 12 08:22:12 2011
@@ -19,6 +19,7 @@ package org.apache.solr.search;
 
 import org.apache.lucene.search.*;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.packed.Direct16;
 import org.apache.lucene.util.packed.Direct32;
@@ -101,8 +102,8 @@ class TermOrdValComparator_SML extends F
   }
 
   @Override
-  public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-    return TermOrdValComparator_SML.createComparator(reader, this);
+  public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+    return TermOrdValComparator_SML.createComparator(context.reader, this);
   }
 
   // Base class for specialized (per bit width of the
@@ -142,8 +143,8 @@ class TermOrdValComparator_SML extends F
     }
 
     @Override
-    public FieldComparator setNextReader(IndexReader reader, int docBase) throws IOException {
-      return TermOrdValComparator_SML.createComparator(reader, parent);
+    public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+      return TermOrdValComparator_SML.createComparator(context.reader, parent);
     }
 
     @Override



Mime
View raw message