lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject svn commit: r1058431 [2/2] - in /lucene/dev/trunk: lucene/src/java/org/apache/lucene/search/ lucene/src/java/org/apache/lucene/search/function/ lucene/src/java/org/apache/lucene/util/ lucene/src/test/org/apache/lucene/search/function/ solr/src/java/org...
Date Thu, 13 Jan 2011 07:13:28 GMT
Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FileFloatSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FileFloatSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FileFloatSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FileFloatSource.java Thu Jan 13 07:13:23 2011
@@ -18,15 +18,17 @@ package org.apache.solr.search.function;
 
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.DocsEnum;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
+import org.apache.lucene.index.IndexReader.ReaderContext;
 import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.index.MultiFields;
+import org.apache.lucene.util.ReaderUtil;
 import org.apache.lucene.util.StringHelper;
 import org.apache.lucene.util.BytesRef;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.schema.SchemaField;
 import org.apache.solr.schema.FieldType;
 import org.apache.solr.search.QParser;
-import org.apache.solr.search.SolrIndexReader;
 import org.apache.solr.util.VersionedFile;
 
 import java.io.*;
@@ -55,19 +57,12 @@ public class FileFloatSource extends Val
     return "float(" + field + ')';
   }
 
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
     int offset = 0;
-    if (reader instanceof SolrIndexReader) {
-      SolrIndexReader r = (SolrIndexReader)reader;
-      while (r.getParent() != null) {
-        offset += r.getBase();
-        r = r.getParent();
-      }
-      reader = r;
-    }
+    ReaderContext topLevelContext = ReaderUtil.getTopLevelContext(readerContext);
     final int off = offset;
 
-    final float[] arr = getCachedFloats(reader);
+    final float[] arr = getCachedFloats(topLevelContext.reader);
     return new DocValues() {
       public float floatVal(int doc) {
         return arr[doc + off];

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FloatFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FloatFieldSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FloatFieldSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FloatFieldSource.java Thu Jan 13 07:13:23 2011
@@ -20,7 +20,7 @@ package org.apache.solr.search.function;
 import java.io.IOException;
 import java.util.Map;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.search.cache.FloatValuesCreator;
 import org.apache.lucene.search.cache.CachedArray.FloatValues;
@@ -45,8 +45,8 @@ public class FloatFieldSource extends Nu
     return "float(" + field + ')';
   }
 
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    final FloatValues vals = cache.getFloats(reader, field, creator);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final FloatValues vals = cache.getFloats(readerContext.reader, field, creator);
     final float[] arr = vals.values;
 	final Bits valid = vals.valid;
     

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FunctionQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FunctionQuery.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FunctionQuery.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FunctionQuery.java Thu Jan 13 07:13:23 2011
@@ -19,7 +19,6 @@ package org.apache.solr.search.function;
 
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexReader.AtomicReaderContext;
-import org.apache.lucene.index.IndexReader.ReaderContext;
 import org.apache.lucene.search.*;
 import org.apache.lucene.index.MultiFields;
 import org.apache.lucene.util.Bits;
@@ -115,7 +114,7 @@ public class FunctionQuery extends Query
     final boolean hasDeletions;
     final Bits delDocs;
 
-    public AllScorer(Similarity similarity, ReaderContext context, FunctionWeight w) throws IOException {
+    public AllScorer(Similarity similarity, AtomicReaderContext context, FunctionWeight w) throws IOException {
       super(similarity);
       this.weight = w;
       this.qWeight = w.getValue();
@@ -124,9 +123,7 @@ public class FunctionQuery extends Query
       this.hasDeletions = reader.hasDeletions();
       this.delDocs = MultiFields.getDeletedDocs(reader);
       assert !hasDeletions || delDocs != null;
-      Map funcContext = weight.context;
-      funcContext.put(reader, context);
-      vals = func.getValues(funcContext, reader);
+      vals = func.getValues(weight.context, context);
     }
 
     @Override

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/IDFValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/IDFValueSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/IDFValueSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/IDFValueSource.java Thu Jan 13 07:13:23 2011
@@ -18,6 +18,7 @@
 package org.apache.solr.search.function;
 
 import org.apache.lucene.index.*;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Similarity;
 import org.apache.lucene.util.BytesRef;
@@ -38,7 +39,7 @@ public class IDFValueSource extends DocF
   }
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
     IndexSearcher searcher = (IndexSearcher)context.get("searcher");
     Similarity sim = searcher.getSimilarity();
     // todo: we need docFreq that takes a BytesRef

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/IntFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/IntFieldSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/IntFieldSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/IntFieldSource.java Thu Jan 13 07:13:23 2011
@@ -18,6 +18,7 @@
 package org.apache.solr.search.function;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.util.Bits;
 import org.apache.solr.search.MutableValueInt;
 import org.apache.solr.search.MutableValue;
@@ -45,8 +46,8 @@ public class IntFieldSource extends Nume
   }
 
 
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    final IntValues vals = cache.getInts(reader, field, creator);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final IntValues vals = cache.getInts(readerContext.reader, field, creator);
     final int[] arr = vals.values;
 	final Bits valid = vals.valid;
     

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/JoinDocFreqValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/JoinDocFreqValueSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/JoinDocFreqValueSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/JoinDocFreqValueSource.java Thu Jan 13 07:13:23 2011
@@ -21,10 +21,11 @@ import java.io.IOException;
 import java.util.Map;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.FieldCache.DocTerms;
 import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.ReaderUtil;
 import org.apache.solr.common.SolrException;
-import org.apache.solr.search.SolrIndexReader;
 
 /**
  * Use a field value and find the Document Frequency within another field.
@@ -46,21 +47,10 @@ public class JoinDocFreqValueSource exte
     return NAME + "(" + field +":("+qfield+"))";
   }
 
-  public DocValues getValues(Map context, IndexReader reader) throws IOException 
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException 
   {
-    final DocTerms terms = cache.getTerms(reader, field, true );
-    
-    int offset = 0;
-    IndexReader topReader = reader;
-    if (topReader instanceof SolrIndexReader) {
-      SolrIndexReader r = (SolrIndexReader)topReader;
-      while (r.getParent() != null) {
-        offset += r.getBase();
-        r = r.getParent();
-      }
-      topReader = r;
-    }
-    final IndexReader top = topReader;
+    final DocTerms terms = cache.getTerms(readerContext.reader, field, true );
+    final IndexReader top = ReaderUtil.getTopLevelContext(readerContext).reader;
     
     return new DocValues() {
       BytesRef ref = new BytesRef();

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/LinearFloatFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/LinearFloatFunction.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/LinearFloatFunction.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/LinearFloatFunction.java Thu Jan 13 07:13:23 2011
@@ -17,7 +17,7 @@
 
 package org.apache.solr.search.function;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 
 import java.io.IOException;
@@ -46,8 +46,8 @@ public class LinearFloatFunction extends
     return slope + "*float(" + source.description() + ")+" + intercept;
   }
 
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    final DocValues vals =  source.getValues(context, reader);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final DocValues vals =  source.getValues(context, readerContext);
     return new DocValues() {
       public float floatVal(int doc) {
         return vals.floatVal(doc) * slope + intercept;

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/LiteralValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/LiteralValueSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/LiteralValueSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/LiteralValueSource.java Thu Jan 13 07:13:23 2011
@@ -16,7 +16,7 @@ package org.apache.solr.search.function;
  * limitations under the License.
  */
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 
 import java.util.Map;
 import java.io.IOException;
@@ -38,7 +38,7 @@ public class LiteralValueSource extends 
   }
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
 
     return new DocValues() {
       @Override

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/LongFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/LongFieldSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/LongFieldSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/LongFieldSource.java Thu Jan 13 07:13:23 2011
@@ -18,6 +18,7 @@
 package org.apache.solr.search.function;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.search.cache.LongValuesCreator;
 import org.apache.lucene.search.cache.CachedArray.LongValues;
@@ -50,8 +51,8 @@ public class LongFieldSource extends Num
     return Long.parseLong(extVal);
   }
 
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    final LongValues vals = cache.getLongs(reader, field, creator);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final LongValues vals = cache.getLongs(readerContext.reader, field, creator);
     final long[] arr = vals.values;
 	final Bits valid = vals.valid;
     

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/MaxDocValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/MaxDocValueSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/MaxDocValueSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/MaxDocValueSource.java Thu Jan 13 07:13:23 2011
@@ -16,7 +16,7 @@
  */
 package org.apache.solr.search.function;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 
 import java.io.IOException;
@@ -38,7 +38,7 @@ public class MaxDocValueSource extends V
   }
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
     IndexSearcher searcher = (IndexSearcher)context.get("searcher");
     return new ConstIntDocValues(searcher.maxDoc(), this);
   }

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/MaxFloatFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/MaxFloatFunction.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/MaxFloatFunction.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/MaxFloatFunction.java Thu Jan 13 07:13:23 2011
@@ -17,7 +17,7 @@
 
 package org.apache.solr.search.function;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 
 import java.io.IOException;
@@ -45,8 +45,8 @@ public class MaxFloatFunction extends Va
     return "max(" + source.description() + "," + fval + ")";
   }
 
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    final DocValues vals =  source.getValues(context, reader);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final DocValues vals =  source.getValues(context, readerContext);
     return new DocValues() {
       public float floatVal(int doc) {
 	float v = vals.floatVal(doc);

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/MultiFloatFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/MultiFloatFunction.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/MultiFloatFunction.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/MultiFloatFunction.java Thu Jan 13 07:13:23 2011
@@ -16,7 +16,7 @@ package org.apache.solr.search.function;
  * limitations under the License.
  */
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 
 import java.util.Map;
@@ -54,10 +54,10 @@ public abstract class MultiFloatFunction
     return sb.toString();
   }
 
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
     final DocValues[] valsArr = new DocValues[sources.length];
     for (int i=0; i<sources.length; i++) {
-      valsArr[i] = sources[i].getValues(context, reader);
+      valsArr[i] = sources[i].getValues(context, readerContext);
     }
 
     return new DocValues() {

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/NormValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/NormValueSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/NormValueSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/NormValueSource.java Thu Jan 13 07:13:23 2011
@@ -17,7 +17,7 @@
 
 package org.apache.solr.search.function;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Similarity;
 import java.io.IOException;
@@ -44,10 +44,10 @@ public class NormValueSource extends Val
   }
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
     IndexSearcher searcher = (IndexSearcher)context.get("searcher");
     final Similarity similarity = searcher.getSimilarity();
-    final byte[] norms = reader.norms(field);
+    final byte[] norms = readerContext.reader.norms(field);
     if (norms == null) {
       return new ConstDoubleDocValues(0.0, this);
     }

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/NumDocsValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/NumDocsValueSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/NumDocsValueSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/NumDocsValueSource.java Thu Jan 13 07:13:23 2011
@@ -16,8 +16,8 @@
  */
 package org.apache.solr.search.function;
 
-import org.apache.lucene.index.IndexReader;
-import org.apache.solr.search.SolrIndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
+import org.apache.lucene.util.ReaderUtil;
 
 import java.io.IOException;
 import java.util.Map;
@@ -33,11 +33,9 @@ public class NumDocsValueSource extends 
   }
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
     // Searcher has no numdocs so we must use the reader instead
-    SolrIndexReader topReader = (SolrIndexReader)reader;
-    while (topReader.getParent() != null) topReader = topReader.getParent();
-    return new ConstIntDocValues(topReader.numDocs(), this);
+    return new ConstIntDocValues(ReaderUtil.getTopLevelContext(readerContext).reader.numDocs(), this);
   }
 
   @Override

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/OrdFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/OrdFieldSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/OrdFieldSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/OrdFieldSource.java Thu Jan 13 07:13:23 2011
@@ -18,10 +18,11 @@
 package org.apache.solr.search.function;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.FieldCache;
+import org.apache.lucene.util.ReaderUtil;
 import org.apache.solr.search.MutableValue;
 import org.apache.solr.search.MutableValueInt;
-import org.apache.solr.search.SolrIndexReader;
 
 import java.io.IOException;
 import java.util.Map;
@@ -56,21 +57,10 @@ public class OrdFieldSource extends Valu
   }
 
 
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    int offset = 0;
-    IndexReader topReader = reader;
-    if (topReader instanceof SolrIndexReader) {
-      SolrIndexReader r = (SolrIndexReader)topReader;
-      while (r.getParent() != null) {
-        offset += r.getBase();
-        r = r.getParent();
-      }
-      topReader = r;
-    }
-    final int off = offset;
-
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final int off = readerContext.docBase;
+    final IndexReader topReader = ReaderUtil.getTopLevelContext(readerContext).reader;
     final FieldCache.DocTermsIndex sindex = FieldCache.DEFAULT.getTermsIndex(topReader, field);
-
     return new DocValues() {
       protected String toTerm(String readableValue) {
         return readableValue;

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/QueryValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/QueryValueSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/QueryValueSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/QueryValueSource.java Thu Jan 13 07:13:23 2011
@@ -18,7 +18,9 @@
 package org.apache.solr.search.function;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.*;
+import org.apache.lucene.util.ReaderUtil;
 import org.apache.solr.common.SolrException;
 
 import java.io.IOException;
@@ -44,8 +46,8 @@ public class QueryValueSource extends Va
   }
 
   @Override
-  public DocValues getValues(Map fcontext, IndexReader reader) throws IOException {
-    return new QueryDocValues(reader, q, defVal, fcontext);
+  public DocValues getValues(Map fcontext, AtomicReaderContext readerContext) throws IOException {
+    return new QueryDocValues(readerContext, q, defVal, fcontext);
   }
 
   public int hashCode() {
@@ -68,7 +70,8 @@ public class QueryValueSource extends Va
 
 class QueryDocValues extends DocValues {
   final Query q;
-  final IndexReader reader;
+//  final IndexReader reader;
+  final AtomicReaderContext readerContext;
   final Weight weight;
   final float defVal;
   final Map fcontext;
@@ -79,21 +82,28 @@ class QueryDocValues extends DocValues {
   // the last document requested... start off with high value
   // to trigger a scorer reset on first access.
   int lastDocRequested=Integer.MAX_VALUE;
+  
 
-  public QueryDocValues(IndexReader reader, Query q, float defVal, Map fcontext) throws IOException {
-    this.reader = reader;
+  public QueryDocValues(AtomicReaderContext readerContext, Query q, float defVal, Map fcontext) throws IOException {
+    IndexReader reader = readerContext.reader;
+    this.readerContext = readerContext;
     this.q = q;
     this.defVal = defVal;
     this.fcontext = fcontext;
 
     Weight w = fcontext==null ? null : (Weight)fcontext.get(q);
+    // TODO: sort by function doesn't weight (SOLR-1297 is open because of this bug)... so weightSearcher will currently be null
     if (w == null) {
-       IndexSearcher weightSearcher = fcontext == null ? new IndexSearcher(reader) : (IndexSearcher)fcontext.get("searcher");
-
-       // TODO: sort by function doesn't weight (SOLR-1297 is open because of this bug)... so weightSearcher will currently be null
-       if (weightSearcher == null) weightSearcher = new IndexSearcher(reader);
-
-       w = q.weight(weightSearcher);
+      IndexSearcher weightSearcher;
+      if(fcontext == null) {
+        weightSearcher = new IndexSearcher(ReaderUtil.getTopLevelContext(readerContext), readerContext);
+      } else {
+        weightSearcher = (IndexSearcher)fcontext.get("searcher");
+        if (weightSearcher == null) {
+          weightSearcher = new IndexSearcher(ReaderUtil.getTopLevelContext(readerContext), readerContext);
+        }
+      }
+      w = q.weight(weightSearcher);
     }
     weight = w;
   }
@@ -101,15 +111,7 @@ class QueryDocValues extends DocValues {
   public float floatVal(int doc) {
     try {
       if (doc < lastDocRequested) {
-        // out-of-order access.... reset scorer.
-        IndexReader.AtomicReaderContext ctx = ValueSource.readerToContext(fcontext, reader);
-
-        if (ctx == null) {
-          // TODO: this is because SOLR-1297 does not weight
-          ctx = (IndexReader.AtomicReaderContext)reader.getTopReaderContext();  // this is the incorrect context
-        }
-
-        scorer = weight.scorer(ctx, true, false);
+        scorer = weight.scorer(readerContext, true, false);
         if (scorer==null) return defVal;
         scorerDoc = -1;
       }

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/RangeMapFloatFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/RangeMapFloatFunction.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/RangeMapFloatFunction.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/RangeMapFloatFunction.java Thu Jan 13 07:13:23 2011
@@ -17,7 +17,7 @@
 
 package org.apache.solr.search.function;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 
 import java.io.IOException;
@@ -50,8 +50,8 @@ public class RangeMapFloatFunction exten
     return "map(" + source.description() + "," + min + "," + max + "," + target + ")";
   }
 
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    final DocValues vals =  source.getValues(context, reader);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final DocValues vals =  source.getValues(context, readerContext);
     return new DocValues() {
       public float floatVal(int doc) {
         float val = vals.floatVal(doc);

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ReciprocalFloatFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ReciprocalFloatFunction.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ReciprocalFloatFunction.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ReciprocalFloatFunction.java Thu Jan 13 07:13:23 2011
@@ -17,7 +17,7 @@
 
 package org.apache.solr.search.function;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 
 import java.io.IOException;
@@ -57,8 +57,8 @@ public class ReciprocalFloatFunction ext
     this.b=b;
   }
 
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    final DocValues vals = source.getValues(context, reader);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final DocValues vals = source.getValues(context, readerContext);
     return new DocValues() {
       public float floatVal(int doc) {
         return a/(m*vals.floatVal(doc) + b);

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ReverseOrdFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ReverseOrdFieldSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ReverseOrdFieldSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ReverseOrdFieldSource.java Thu Jan 13 07:13:23 2011
@@ -18,8 +18,9 @@
 package org.apache.solr.search.function;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.FieldCache;
-import org.apache.solr.search.SolrIndexReader;
+import org.apache.lucene.util.ReaderUtil;
 
 import java.io.IOException;
 import java.util.Map;
@@ -56,18 +57,9 @@ public class ReverseOrdFieldSource exten
     return "rord("+field+')';
   }
 
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    int offset = 0;
-    IndexReader topReader = reader;
-    if (topReader instanceof SolrIndexReader) {
-      SolrIndexReader r = (SolrIndexReader)topReader;
-      while (r.getParent() != null) {
-        offset += r.getBase();
-        r = r.getParent();
-      }
-      topReader = r;
-    }
-    final int off = offset;
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final IndexReader topReader = ReaderUtil.getTopLevelContext(readerContext).reader;
+    final int off = readerContext.docBase;
 
     final FieldCache.DocTermsIndex sindex = FieldCache.DEFAULT.getTermsIndex(topReader, field);
     final int end = sindex.numOrd();

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ScaleFloatFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ScaleFloatFunction.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ScaleFloatFunction.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ScaleFloatFunction.java Thu Jan 13 07:13:23 2011
@@ -17,7 +17,6 @@
 
 package org.apache.solr.search.function;
 
-import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.util.ReaderUtil;
@@ -56,17 +55,15 @@ public class ScaleFloatFunction extends 
     float maxVal;
   }
 
-  private ScaleInfo createScaleInfo(Map context, IndexReader reader) throws IOException {
-    IndexReader.ReaderContext ctx = ValueSource.readerToContext(context, reader);
-    while (ctx.parent != null) ctx = ctx.parent;
-    final AtomicReaderContext[] leaves = ReaderUtil.leaves(ctx);
+  private ScaleInfo createScaleInfo(Map context, AtomicReaderContext readerContext) throws IOException {
+    final AtomicReaderContext[] leaves = ReaderUtil.leaves(ReaderUtil.getTopLevelContext(readerContext));
 
     float minVal = Float.POSITIVE_INFINITY;
     float maxVal = Float.NEGATIVE_INFINITY;
 
     for (AtomicReaderContext leaf : leaves) {
       int maxDoc = leaf.reader.maxDoc();
-      DocValues vals =  source.getValues(context, leaf.reader);
+      DocValues vals =  source.getValues(context, leaf);
       for (int i=0; i<maxDoc; i++) {
 
       float val = vals.floatVal(i);
@@ -96,18 +93,18 @@ public class ScaleFloatFunction extends 
     return scaleInfo;
   }
 
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
 
     ScaleInfo scaleInfo = (ScaleInfo)context.get(source);
     if (scaleInfo == null) {
-      scaleInfo = createScaleInfo(context, reader);
+      scaleInfo = createScaleInfo(context, readerContext);
     }
 
     final float scale = (scaleInfo.maxVal-scaleInfo.minVal==0) ? 0 : (max-min)/(scaleInfo.maxVal-scaleInfo.minVal);
     final float minSource = scaleInfo.minVal;
     final float maxSource = scaleInfo.maxVal;
 
-    final DocValues vals =  source.getValues(context, reader);
+    final DocValues vals =  source.getValues(context, readerContext);
 
     return new DocValues() {
       public float floatVal(int doc) {

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ShortFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ShortFieldSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ShortFieldSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ShortFieldSource.java Thu Jan 13 07:13:23 2011
@@ -18,7 +18,7 @@ package org.apache.solr.search.function;
 
 import org.apache.lucene.search.cache.ShortValuesCreator;
 import org.apache.lucene.search.cache.CachedArray.ShortValues;
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 
 import java.io.IOException;
 import java.util.Map;
@@ -39,8 +39,8 @@ public class ShortFieldSource extends Nu
     return "short(" + field + ')';
   }
 
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    final ShortValues vals = cache.getShorts(reader, field, creator);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final ShortValues vals = cache.getShorts(readerContext.reader, field, creator);
     final short[] arr = vals.values;
     
     return new DocValues() {

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/SimpleFloatFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/SimpleFloatFunction.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/SimpleFloatFunction.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/SimpleFloatFunction.java Thu Jan 13 07:13:23 2011
@@ -17,7 +17,7 @@
 
 package org.apache.solr.search.function;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 
 import java.io.IOException;
 import java.util.Map;
@@ -32,8 +32,8 @@ import java.util.Map;
   protected abstract float func(int doc, DocValues vals);
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    final DocValues vals =  source.getValues(context, reader);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final DocValues vals =  source.getValues(context, readerContext);
     return new DocValues() {
       public float floatVal(int doc) {
 	return func(doc, vals);

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/StringIndexDocValues.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/StringIndexDocValues.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/StringIndexDocValues.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/StringIndexDocValues.java Thu Jan 13 07:13:23 2011
@@ -19,6 +19,7 @@ package org.apache.solr.search.function;
 
 import org.apache.lucene.search.FieldCache;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.util.BytesRef;
 import org.apache.solr.search.MutableValue;
 import org.apache.solr.search.MutableValueStr;
@@ -33,9 +34,9 @@ public abstract class StringIndexDocValu
     protected final ValueSource vs;
     protected final MutableValueStr val = new MutableValueStr();
 
-    public StringIndexDocValues(ValueSource vs, IndexReader reader, String field) throws IOException {
+    public StringIndexDocValues(ValueSource vs, AtomicReaderContext context, String field) throws IOException {
       try {
-        termsIndex = FieldCache.DEFAULT.getTermsIndex(reader, field);
+        termsIndex = FieldCache.DEFAULT.getTermsIndex(context.reader, field);
       } catch (RuntimeException e) {
         throw new StringIndexException(field, e);
       }

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/TFValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/TFValueSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/TFValueSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/TFValueSource.java Thu Jan 13 07:13:23 2011
@@ -1,6 +1,7 @@
 package org.apache.solr.search.function;
 
 import org.apache.lucene.index.*;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Similarity;
@@ -21,9 +22,8 @@ public class TFValueSource extends TermF
   }
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    // use MultiFields, just in case someone did a top() function
-    Fields fields = MultiFields.getFields(reader);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    Fields fields = readerContext.reader.fields();
     final Terms terms = fields.terms(field);
     final Similarity similarity = ((IndexSearcher)context.get("searcher")).getSimilarity();
 

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/TermFreqValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/TermFreqValueSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/TermFreqValueSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/TermFreqValueSource.java Thu Jan 13 07:13:23 2011
@@ -18,6 +18,7 @@
 package org.apache.solr.search.function;
 
 import org.apache.lucene.index.*;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.util.BytesRef;
 import org.apache.solr.common.SolrException;
@@ -36,9 +37,8 @@ public class TermFreqValueSource extends
   }
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    // use MultiFields, just in case someone did a top() function
-    Fields fields = MultiFields.getFields(reader);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    Fields fields = readerContext.reader.fields();
     final Terms terms = fields.terms(field);
 
     return new IntDocValues(this) {

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ValueSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ValueSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ValueSource.java Thu Jan 13 07:13:23 2011
@@ -19,7 +19,6 @@ package org.apache.solr.search.function;
 
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexReader.AtomicReaderContext;
-import org.apache.lucene.index.IndexReader.ReaderContext;
 import org.apache.lucene.search.FieldComparator;
 import org.apache.lucene.search.FieldComparatorSource;
 import org.apache.lucene.search.Scorer;
@@ -47,7 +46,7 @@ public abstract class ValueSource implem
    * Gets the values for this reader and the context that was previously
    * passed to createWeight()
    */
-  public abstract DocValues getValues(Map context, IndexReader reader) throws IOException;
+  public abstract DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException;
 
   public abstract boolean equals(Object o);
 
@@ -66,7 +65,7 @@ public abstract class ValueSource implem
    * EXPERIMENTAL: This method is subject to change.
    * <br>WARNING: Sorted function queries are not currently weighted.
    * <p>
-   * Get the SortField for this ValueSource.  Uses the {@link #getValues(java.util.Map, org.apache.lucene.index.IndexReader)}
+   * Get the SortField for this ValueSource.  Uses the {@link #getValues(java.util.Map, AtomicReaderContext)}
    * to populate the SortField.
    * 
    * @param reverse true if this is a reverse sort.
@@ -98,40 +97,6 @@ public abstract class ValueSource implem
     return context;
   }
 
-  /* @lucene.internal
-   * This will most likely go away in the future.
-   */
-  public static AtomicReaderContext readerToContext(Map fcontext, IndexReader reader) {
-    Object v = fcontext.get(reader);
-    if (v == null) {
-      IndexSearcher searcher = (IndexSearcher)fcontext.get("searcher");
-      if (searcher == null) {
-        return null;
-        // TODO
-        // throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "no searcher found in function context");
-      }
-      ReaderContext rcontext = searcher.getIndexReader().getTopReaderContext();
-      if (rcontext.isAtomic) {
-        assert rcontext.reader == reader;
-        fcontext.put(rcontext.reader, (AtomicReaderContext)rcontext);
-      } else {
-        for (AtomicReaderContext subCtx : rcontext.leaves()) {
-          fcontext.put(subCtx.reader, subCtx);
-        }
-      }
-
-      v = fcontext.get(reader);
-      if (v == null) {
-        return null;
-        // TODO
-        // throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "reader " + reader + " is not from the top reader " + searcher.getIndexReader());
-      }
-    }
-
-    return (AtomicReaderContext)v;
-  }
-
-
   class ValueSourceComparatorSource extends FieldComparatorSource {
 
 
@@ -188,7 +153,7 @@ public abstract class ValueSource implem
     }
 
     public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
-      docVals = getValues(Collections.emptyMap(), context.reader);
+      docVals = getValues(Collections.emptyMap(), context);
       return this;
     }
 

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ValueSourceRangeFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ValueSourceRangeFilter.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ValueSourceRangeFilter.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/ValueSourceRangeFilter.java Thu Jan 13 07:13:23 2011
@@ -20,7 +20,7 @@ package org.apache.solr.search.function;
 import org.apache.lucene.search.DocIdSet;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.IndexSearcher;
-import org.apache.lucene.index.IndexReader.ReaderContext;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.solr.search.SolrFilter;
 
 import java.io.IOException;
@@ -49,10 +49,10 @@ public class ValueSourceRangeFilter exte
     this.includeUpper = upperVal != null && includeUpper;
   }
 
-  public DocIdSet getDocIdSet(final Map context, final ReaderContext readerContext) throws IOException {
+  public DocIdSet getDocIdSet(final Map context, final AtomicReaderContext readerContext) throws IOException {
      return new DocIdSet() {
        public DocIdSetIterator iterator() throws IOException {
-         return valueSource.getValues(context, readerContext.reader).getRangeScorer(readerContext.reader, lowerVal, upperVal, includeLower, includeUpper);
+         return valueSource.getValues(context, readerContext).getRangeScorer(readerContext.reader, lowerVal, upperVal, includeLower, includeUpper);
        }
      };
   }

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/VectorValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/VectorValueSource.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/VectorValueSource.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/VectorValueSource.java Thu Jan 13 07:13:23 2011
@@ -16,7 +16,7 @@ package org.apache.solr.search.function;
  * limitations under the License.
  */
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.solr.search.function.MultiValueSource;
 import org.apache.solr.search.function.DocValues;
@@ -53,13 +53,13 @@ public class VectorValueSource extends M
   }
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
     int size = sources.size();
 
     // special-case x,y and lat,lon since it's so common
     if (size==2) {
-      final DocValues x = sources.get(0).getValues(context, reader);
-      final DocValues y = sources.get(1).getValues(context, reader);
+      final DocValues x = sources.get(0).getValues(context, readerContext);
+      final DocValues y = sources.get(1).getValues(context, readerContext);
       return new DocValues() {
         @Override
         public void byteVal(int doc, byte[] vals) {
@@ -106,7 +106,7 @@ public class VectorValueSource extends M
 
     final DocValues[] valsArr = new DocValues[size];
     for (int i = 0; i < size; i++) {
-      valsArr[i] = sources.get(i).getValues(context, reader);
+      valsArr[i] = sources.get(i).getValues(context, readerContext);
     }
 
     return new DocValues() {

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/GeohashFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/GeohashFunction.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/GeohashFunction.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/GeohashFunction.java Thu Jan 13 07:13:23 2011
@@ -18,7 +18,7 @@ package org.apache.solr.search.function.
 
 import org.apache.solr.search.function.ValueSource;
 import org.apache.solr.search.function.DocValues;
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.spatial.geohash.GeoHashUtils;
 
 import java.util.Map;
@@ -46,9 +46,9 @@ public class GeohashFunction extends Val
   }
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    final DocValues latDV = lat.getValues(context, reader);
-    final DocValues lonDV = lon.getValues(context, reader);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final DocValues latDV = lat.getValues(context, readerContext);
+    final DocValues lonDV = lon.getValues(context, readerContext);
 
 
     return new DocValues() {

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/GeohashHaversineFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/GeohashHaversineFunction.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/GeohashHaversineFunction.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/GeohashHaversineFunction.java Thu Jan 13 07:13:23 2011
@@ -20,7 +20,7 @@ package org.apache.solr.search.function.
 import org.apache.lucene.spatial.DistanceUtils;
 import org.apache.solr.search.function.ValueSource;
 import org.apache.solr.search.function.DocValues;
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.spatial.geohash.GeoHashUtils;
 
@@ -54,9 +54,9 @@ public class GeohashHaversineFunction ex
   }
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    final DocValues gh1DV = geoHash1.getValues(context, reader);
-    final DocValues gh2DV = geoHash2.getValues(context, reader);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final DocValues gh1DV = geoHash1.getValues(context, readerContext);
+    final DocValues gh2DV = geoHash2.getValues(context, readerContext);
 
     return new DocValues() {
       public float floatVal(int doc) {

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/HaversineConstFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/HaversineConstFunction.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/HaversineConstFunction.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/HaversineConstFunction.java Thu Jan 13 07:13:23 2011
@@ -16,7 +16,7 @@ package org.apache.solr.search.function.
  * limitations under the License.
  */
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.queryParser.ParseException;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.spatial.DistanceUtils;
@@ -190,9 +190,9 @@ public class HaversineConstFunction exte
   }
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    final DocValues latVals = latSource.getValues(context, reader);
-    final DocValues lonVals = lonSource.getValues(context, reader);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final DocValues latVals = latSource.getValues(context, readerContext);
+    final DocValues lonVals = lonSource.getValues(context, readerContext);
     final double latCenterRad = this.latCenter * DistanceUtils.DEGREES_TO_RADIANS;
     final double lonCenterRad = this.lonCenter * DistanceUtils.DEGREES_TO_RADIANS;
     final double latCenterRad_cos = this.latCenterRad_cos;

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/HaversineFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/HaversineFunction.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/HaversineFunction.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/HaversineFunction.java Thu Jan 13 07:13:23 2011
@@ -16,7 +16,7 @@ package org.apache.solr.search.function.
  * limitations under the License.
  */
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.spatial.DistanceUtils;
 import org.apache.solr.common.SolrException;
@@ -95,10 +95,10 @@ public class HaversineFunction extends V
 
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    final DocValues vals1 = p1.getValues(context, reader);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final DocValues vals1 = p1.getValues(context, readerContext);
 
-    final DocValues vals2 = p2.getValues(context, reader);
+    final DocValues vals2 = p2.getValues(context, readerContext);
     return new DocValues() {
       public float floatVal(int doc) {
         return (float) doubleVal(doc);

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/StringDistanceFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/StringDistanceFunction.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/StringDistanceFunction.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/StringDistanceFunction.java Thu Jan 13 07:13:23 2011
@@ -1,6 +1,6 @@
 package org.apache.solr.search.function.distance;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.spell.StringDistance;
 import org.apache.solr.search.function.DocValues;
 import org.apache.solr.search.function.ValueSource;
@@ -31,9 +31,9 @@ public class StringDistanceFunction exte
   }
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
-    final DocValues str1DV = str1.getValues(context, reader);
-    final DocValues str2DV = str2.getValues(context, reader);
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
+    final DocValues str1DV = str1.getValues(context, readerContext);
+    final DocValues str2DV = str2.getValues(context, readerContext);
     return new DocValues() {
 
       public float floatVal(int doc) {

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/VectorDistanceFunction.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/VectorDistanceFunction.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/VectorDistanceFunction.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/distance/VectorDistanceFunction.java Thu Jan 13 07:13:23 2011
@@ -16,7 +16,7 @@ package org.apache.solr.search.function.
  * limitations under the License.
  */
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.spatial.DistanceUtils;
 import org.apache.solr.common.SolrException;
@@ -78,11 +78,11 @@ public class VectorDistanceFunction exte
   }
 
   @Override
-  public DocValues getValues(Map context, IndexReader reader) throws IOException {
+  public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
 
-    final DocValues vals1 = source1.getValues(context, reader);
+    final DocValues vals1 = source1.getValues(context, readerContext);
 
-    final DocValues vals2 = source2.getValues(context, reader);
+    final DocValues vals2 = source2.getValues(context, readerContext);
 
 
     return new DocValues() {

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/spelling/IndexBasedSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/spelling/IndexBasedSpellChecker.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/spelling/IndexBasedSpellChecker.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/spelling/IndexBasedSpellChecker.java Thu Jan 13 07:13:23 2011
@@ -73,7 +73,7 @@ public class IndexBasedSpellChecker exte
     try {
       if (sourceLocation == null) {
         // Load from Solr's index
-        reader = searcher.getReader();
+        reader = searcher.getIndexReader();
       } else {
         // Load from Lucene index at given sourceLocation
         reader = this.reader;

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/Suggester.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/Suggester.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/Suggester.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/Suggester.java Thu Jan 13 07:13:23 2011
@@ -100,7 +100,7 @@ public class Suggester extends SolrSpell
   public void build(SolrCore core, SolrIndexSearcher searcher) {
     LOG.info("build()");
     if (sourceLocation == null) {
-      reader = searcher.getReader();
+      reader = searcher.getIndexReader();
       dictionary = new HighFrequencyDictionary(reader, field, threshold);
     } else {
       try {

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/update/UpdateHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/update/UpdateHandler.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/update/UpdateHandler.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/update/UpdateHandler.java Thu Jan 13 07:13:23 2011
@@ -152,7 +152,7 @@ public abstract class UpdateHandler impl
     @Override
     public void collect(int doc) {
       try {
-        searcher.getReader().deleteDocument(doc + docBase);
+        searcher.getIndexReader().deleteDocument(doc + docBase);
         deleted++;
       } catch (IOException e) {
         // don't try to close the searcher on failure for now...

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/core/TestConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/core/TestConfig.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/core/TestConfig.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/core/TestConfig.java Thu Jan 13 07:13:23 2011
@@ -139,7 +139,7 @@ public class TestConfig extends SolrTest
     StandardIndexReaderFactory sirf = (StandardIndexReaderFactory) irf;
     assertEquals(12, sirf.termInfosIndexDivisor);
     SolrQueryRequest req = req();
-    assertEquals(12, req.getSearcher().getReader().getTermInfosIndexDivisor());
+    assertEquals(12, req.getSearcher().getIndexReader().getTermInfosIndexDivisor());
     req.close();
   }
 

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/core/TestQuerySenderListener.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/core/TestQuerySenderListener.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/core/TestQuerySenderListener.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/core/TestQuerySenderListener.java Thu Jan 13 07:13:23 2011
@@ -75,7 +75,7 @@ public class TestQuerySenderListener ext
     String evt = mock.req.getParams().get(EventParams.EVENT);
     assertNotNull("Event is null", evt);
     assertTrue(evt + " is not equal to " + EventParams.FIRST_SEARCHER, evt.equals(EventParams.FIRST_SEARCHER) == true);
-    Directory dir = currentSearcher.getReader().directory();
+    Directory dir = currentSearcher.getIndexReader().directory();
     SolrIndexSearcher newSearcher = new SolrIndexSearcher(core, core.getSchema(), "testQuerySenderListener", dir, true, false);
 
     qsl.newSearcher(newSearcher, currentSearcher);

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java Thu Jan 13 07:13:23 2011
@@ -71,7 +71,7 @@ public class QueryElevationComponentTest
     comp.inform( core );
 
     SolrQueryRequest req = req();
-    IndexReader reader = req.getSearcher().getReader();
+    IndexReader reader = req.getSearcher().getIndexReader();
     Map<String, ElevationObj> map = comp.getElevationMap( reader, core );
     req.close();
 
@@ -130,7 +130,7 @@ public class QueryElevationComponentTest
     args.put( "indent", "true" );
     //args.put( CommonParams.FL, "id,title,score" );
     SolrQueryRequest req = new LocalSolrQueryRequest( h.getCore(), new MapSolrParams( args) );
-    IndexReader reader = req.getSearcher().getReader();
+    IndexReader reader = req.getSearcher().getIndexReader();
     QueryElevationComponent booster = (QueryElevationComponent)req.getCore().getSearchComponent( "elevate" );
 
     assertQ("Make sure standard sort works as expected", req
@@ -255,7 +255,7 @@ public class QueryElevationComponentTest
     comp.inform( h.getCore() );
 
     SolrQueryRequest req = req();
-    IndexReader reader = req.getSearcher().getReader();
+    IndexReader reader = req.getSearcher().getIndexReader();
     Map<String, ElevationObj> map = comp.getElevationMap(reader, h.getCore());
     assertTrue( map.get( "aaa" ).priority.containsKey( new BytesRef("A") ) );
     assertNull( map.get( "bbb" ) );
@@ -267,7 +267,7 @@ public class QueryElevationComponentTest
     assertU(commit());
 
     req = req();
-    reader = req.getSearcher().getReader();
+    reader = req.getSearcher().getIndexReader();
     map = comp.getElevationMap(reader, h.getCore());
     assertNull( map.get( "aaa" ) );
     assertTrue( map.get( "bbb" ).priority.containsKey( new BytesRef("B") ) );

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/request/TestFaceting.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/request/TestFaceting.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/request/TestFaceting.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/request/TestFaceting.java Thu Jan 13 07:13:23 2011
@@ -67,14 +67,14 @@ public class TestFaceting extends SolrTe
     req = lrf.makeRequest("q","*:*");
 
     TermIndex ti = new TermIndex(proto.field());
-    NumberedTermsEnum te = ti.getEnumerator(req.getSearcher().getReader());
+    NumberedTermsEnum te = ti.getEnumerator(req.getSearcher().getIndexReader());
 
     // iterate through first
     while(te.term() != null) te.next();
     assertEquals(size, te.getTermNumber());
     te.close();
 
-    te = ti.getEnumerator(req.getSearcher().getReader());
+    te = ti.getEnumerator(req.getSearcher().getIndexReader());
 
     Random r = new Random(size);
     // test seeking by term string

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/search/TestIndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/search/TestIndexSearcher.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/search/TestIndexSearcher.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/search/TestIndexSearcher.java Thu Jan 13 07:13:23 2011
@@ -45,7 +45,7 @@ public class TestIndexSearcher extends S
     AtomicReaderContext[] leaves = ReaderUtil.leaves(topReaderContext);
     int idx = ReaderUtil.subIndex(doc, leaves);
     AtomicReaderContext leaf = leaves[idx];
-    DocValues vals = vs.getValues(context, leaf.reader);
+    DocValues vals = vs.getValues(context, leaf);
     return vals.strVal(doc-leaf.docBase);
   }
 

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/spelling/DirectSolrSpellCheckerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/spelling/DirectSolrSpellCheckerTest.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/spelling/DirectSolrSpellCheckerTest.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/spelling/DirectSolrSpellCheckerTest.java Thu Jan 13 07:13:23 2011
@@ -62,7 +62,7 @@ public class DirectSolrSpellCheckerTest 
 
     RefCounted<SolrIndexSearcher> searcher = core.getSearcher();
     Collection<Token> tokens = queryConverter.convert("fob");
-    SpellingOptions spellOpts = new SpellingOptions(tokens, searcher.get().getReader());
+    SpellingOptions spellOpts = new SpellingOptions(tokens, searcher.get().getIndexReader());
     SpellingResult result = checker.getSuggestions(spellOpts);
     assertTrue("result is null and it shouldn't be", result != null);
     Map<String, Integer> suggestions = result.get(tokens.iterator().next());

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/spelling/FileBasedSpellCheckerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/spelling/FileBasedSpellCheckerTest.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/spelling/FileBasedSpellCheckerTest.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/spelling/FileBasedSpellCheckerTest.java Thu Jan 13 07:13:23 2011
@@ -78,7 +78,7 @@ public class FileBasedSpellCheckerTest e
 
     RefCounted<SolrIndexSearcher> searcher = core.getSearcher();
     Collection<Token> tokens = queryConverter.convert("fob");
-    SpellingOptions spellOpts = new SpellingOptions(tokens, searcher.get().getReader());
+    SpellingOptions spellOpts = new SpellingOptions(tokens, searcher.get().getIndexReader());
     SpellingResult result = checker.getSuggestions(spellOpts);
     assertTrue("result is null and it shouldn't be", result != null);
     Map<String, Integer> suggestions = result.get(tokens.iterator().next());
@@ -117,7 +117,7 @@ public class FileBasedSpellCheckerTest e
     RefCounted<SolrIndexSearcher> searcher = core.getSearcher();
     Collection<Token> tokens = queryConverter.convert("Solar");
 
-    SpellingOptions spellOpts = new SpellingOptions(tokens, searcher.get().getReader());
+    SpellingOptions spellOpts = new SpellingOptions(tokens, searcher.get().getIndexReader());
     SpellingResult result = checker.getSuggestions(spellOpts);
     assertTrue("result is null and it shouldn't be", result != null);
     //should be lowercased, b/c we are using a lowercasing analyzer
@@ -160,7 +160,7 @@ public class FileBasedSpellCheckerTest e
 
     RefCounted<SolrIndexSearcher> searcher = core.getSearcher();
     Collection<Token> tokens = queryConverter.convert("solar");
-    SpellingOptions spellOpts = new SpellingOptions(tokens, searcher.get().getReader());
+    SpellingOptions spellOpts = new SpellingOptions(tokens, searcher.get().getIndexReader());
     SpellingResult result = checker.getSuggestions(spellOpts);
     assertTrue("result is null and it shouldn't be", result != null);
     //should be lowercased, b/c we are using a lowercasing analyzer

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java Thu Jan 13 07:13:23 2011
@@ -121,7 +121,7 @@ public class IndexBasedSpellCheckerTest 
     try {
     checker.build(core, searcher);
 
-    IndexReader reader = searcher.getReader();
+    IndexReader reader = searcher.getIndexReader();
     Collection<Token> tokens = queryConverter.convert("documemt");
     SpellingOptions spellOpts = new SpellingOptions(tokens, reader);
     SpellingResult result = checker.getSuggestions(spellOpts);
@@ -196,7 +196,7 @@ public class IndexBasedSpellCheckerTest 
     try {
     checker.build(core, searcher);
 
-    IndexReader reader = searcher.getReader();
+    IndexReader reader = searcher.getIndexReader();
     Collection<Token> tokens = queryConverter.convert("documemt");
     SpellingOptions spellOpts = new SpellingOptions(tokens, reader, 1, false, true, 0.5f, null);
     SpellingResult result = checker.getSuggestions(spellOpts);
@@ -309,7 +309,7 @@ public class IndexBasedSpellCheckerTest 
     try {
     checker.build(core, searcher);
 
-    IndexReader reader = searcher.getReader();
+    IndexReader reader = searcher.getIndexReader();
     Collection<Token> tokens = queryConverter.convert("flesh");
     SpellingOptions spellOpts = new SpellingOptions(tokens, reader, 1, false, true, 0.5f, null);
     SpellingResult result = checker.getSuggestions(spellOpts);

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java Thu Jan 13 07:13:23 2011
@@ -62,7 +62,7 @@ public class SignatureUpdateProcessorFac
   void checkNumDocs(int n) {
     SolrQueryRequest req = req();
     try {
-      assertEquals(n, req.getSearcher().getReader().numDocs());
+      assertEquals(n, req.getSearcher().getIndexReader().numDocs());
     } finally {
       req.close();
     }

Modified: lucene/dev/trunk/solr/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java?rev=1058431&r1=1058430&r2=1058431&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java (original)
+++ lucene/dev/trunk/solr/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java Thu Jan 13 07:13:23 2011
@@ -95,7 +95,7 @@ public final class HttpCacheHeaderUtil {
   public static String calcEtag(final SolrQueryRequest solrReq) {
     final SolrCore core = solrReq.getCore();
     final long currentIndexVersion
-      = solrReq.getSearcher().getReader().getVersion();
+      = solrReq.getSearcher().getIndexReader().getVersion();
 
     EtagCacheVal etagCache = etagCoreCache.get(core);
     if (null == etagCache) {
@@ -152,7 +152,7 @@ public final class HttpCacheHeaderUtil {
       // assume default, change if needed (getOpenTime() should be fast)
       lastMod =
         LastModFrom.DIRLASTMOD == lastModFrom
-        ? IndexReader.lastModified(searcher.getReader().directory())
+        ? IndexReader.lastModified(searcher.getIndexReader().directory())
         : searcher.getOpenTime();
     } catch (IOException e) {
       // we're pretty freaking screwed if this happens



Mime
View raw message