diff --git a/modules/join/src/java/org/apache/lucene/search/join/TermsCollector.java b/modules/join/src/java/org/apache/lucene/search/join/TermsCollector.java index b8df2256deb..94ec8a79e5a 100644 --- a/modules/join/src/java/org/apache/lucene/search/join/TermsCollector.java +++ b/modules/join/src/java/org/apache/lucene/search/join/TermsCollector.java @@ -17,8 +17,8 @@ package org.apache.lucene.search.join; * limitations under the License. */ +import org.apache.lucene.index.AtomicIndexReader.AtomicReaderContext; import org.apache.lucene.index.DocTermOrds; -import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.search.Collector; import org.apache.lucene.search.FieldCache; @@ -94,9 +94,9 @@ abstract class TermsCollector extends Collector { } while (chunk >= buffer.length); } - public void setNextReader(IndexReader.AtomicReaderContext context) throws IOException { - docTermOrds = FieldCache.DEFAULT.getDocTermOrds(context.reader, field); - docTermsEnum = docTermOrds.getOrdTermsEnum(context.reader); + public void setNextReader(AtomicReaderContext context) throws IOException { + docTermOrds = FieldCache.DEFAULT.getDocTermOrds(context.reader(), field); + docTermsEnum = docTermOrds.getOrdTermsEnum(context.reader()); reuse = null; // LUCENE-3377 needs to be fixed first then this statement can be removed... } } @@ -115,8 +115,8 @@ abstract class TermsCollector extends Collector { collectorTerms.add(fromDocTerms.getTerm(doc, spare)); } - public void setNextReader(IndexReader.AtomicReaderContext context) throws IOException { - fromDocTerms = FieldCache.DEFAULT.getTerms(context.reader, field); + public void setNextReader(AtomicReaderContext context) throws IOException { + fromDocTerms = FieldCache.DEFAULT.getTerms(context.reader(), field); } } diff --git a/modules/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java b/modules/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java index 9014cdf53c5..4637c72e417 100644 --- a/modules/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java +++ b/modules/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java @@ -22,7 +22,7 @@ import java.util.Collection; import java.util.Collections; import java.util.Set; -import org.apache.lucene.index.IndexReader.AtomicReaderContext; +import org.apache.lucene.index.AtomicIndexReader.AtomicReaderContext; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; // javadocs import org.apache.lucene.index.Term; @@ -120,7 +120,7 @@ public class ToChildBlockJoinQuery extends Query { return null; } - final DocIdSet parents = parentsFilter.getDocIdSet(readerContext, readerContext.reader.getLiveDocs()); + final DocIdSet parents = parentsFilter.getDocIdSet(readerContext, readerContext.reader().getLiveDocs()); // TODO: once we do random-access filters we can // generalize this: if (parents == null) { diff --git a/modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java b/modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java index c67a6634725..ff58faf22e9 100644 --- a/modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java +++ b/modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java @@ -24,7 +24,7 @@ import java.util.LinkedList; import java.util.Map; import java.util.Queue; -import org.apache.lucene.index.IndexReader.AtomicReaderContext; +import org.apache.lucene.index.AtomicIndexReader.AtomicReaderContext; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; // javadocs import org.apache.lucene.search.Collector; @@ -107,7 +107,7 @@ public class ToParentBlockJoinCollector extends Collector { private int docBase; private ToParentBlockJoinQuery.BlockJoinScorer[] joinScorers = new ToParentBlockJoinQuery.BlockJoinScorer[0]; - private IndexReader.AtomicReaderContext currentReaderContext; + private AtomicReaderContext currentReaderContext; private Scorer scorer; private boolean queueFull; diff --git a/modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java b/modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java index 5b12b9820bd..20c2ecceb01 100644 --- a/modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java +++ b/modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java @@ -22,7 +22,7 @@ import java.util.Collection; import java.util.Collections; import java.util.Set; -import org.apache.lucene.index.IndexReader.AtomicReaderContext; +import org.apache.lucene.index.AtomicIndexReader.AtomicReaderContext; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; // javadocs import org.apache.lucene.index.Term; @@ -186,7 +186,7 @@ public class ToParentBlockJoinQuery extends Query { return null; } - final DocIdSet parents = parentsFilter.getDocIdSet(readerContext, readerContext.reader.getLiveDocs()); + final DocIdSet parents = parentsFilter.getDocIdSet(readerContext, readerContext.reader().getLiveDocs()); // TODO: once we do random-access filters we can // generalize this: if (parents == null) { diff --git a/modules/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java b/modules/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java index 869a21aa5ea..0404d984419 100644 --- a/modules/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java +++ b/modules/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java @@ -28,7 +28,7 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericField; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.StringField; -import org.apache.lucene.index.IndexReader.AtomicReaderContext; +import org.apache.lucene.index.AtomicIndexReader.AtomicReaderContext; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LogDocMergePolicy; import org.apache.lucene.index.RandomIndexWriter; @@ -160,7 +160,7 @@ public class TestBlockJoin extends LuceneTestCase { final int subIndex = ReaderUtil.subIndex(childDocID, leaves); final AtomicReaderContext leaf = leaves[subIndex]; final FixedBitSet bits = (FixedBitSet) parents.getDocIdSet(leaf, null); - return leaf.reader.document(bits.nextSetBit(childDocID - leaf.docBase)); + return leaf.reader().document(bits.nextSetBit(childDocID - leaf.docBase)); } public void testBoostBug() throws Exception { diff --git a/modules/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java b/modules/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java index 60c50bb0b25..34564cc57b0 100644 --- a/modules/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java +++ b/modules/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java @@ -23,6 +23,7 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; import org.apache.lucene.index.*; +import org.apache.lucene.index.AtomicIndexReader.AtomicReaderContext; import org.apache.lucene.search.*; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; @@ -184,7 +185,7 @@ public class TestJoinUtil extends LuceneTestCase { actualResult.set(doc + docBase); } - public void setNextReader(IndexReader.AtomicReaderContext context) throws IOException { + public void setNextReader(AtomicReaderContext context) throws IOException { docBase = context.docBase; }