lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1459487 - /lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/docvalues/DocTermsIndexDocValues.java
Date Thu, 21 Mar 2013 19:32:50 GMT
Author: rmuir
Date: Thu Mar 21 19:32:50 2013
New Revision: 1459487

URL: http://svn.apache.org/r1459487
Log:
don't waste ram

Modified:
    lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/docvalues/DocTermsIndexDocValues.java

Modified: lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/docvalues/DocTermsIndexDocValues.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/docvalues/DocTermsIndexDocValues.java?rev=1459487&r1=1459486&r2=1459487&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/docvalues/DocTermsIndexDocValues.java
(original)
+++ lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/docvalues/DocTermsIndexDocValues.java
Thu Mar 21 19:32:50 2013
@@ -26,7 +26,6 @@ import org.apache.lucene.queries.functio
 import org.apache.lucene.queries.function.ValueSource;
 import org.apache.lucene.queries.function.ValueSourceScorer;
 import org.apache.lucene.search.FieldCache;
-import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.CharsRef;
 import org.apache.lucene.util.UnicodeUtil;
@@ -39,7 +38,6 @@ import org.apache.lucene.util.mutable.Mu
  */
 public abstract class DocTermsIndexDocValues extends FunctionValues {
   protected final SortedDocValues termsIndex;
-  protected final Bits valid;
   protected final ValueSource vs;
   protected final MutableValueStr val = new MutableValueStr();
   protected final BytesRef spare = new BytesRef();
@@ -48,7 +46,6 @@ public abstract class DocTermsIndexDocVa
   public DocTermsIndexDocValues(ValueSource vs, AtomicReaderContext context, String field)
throws IOException {
     try {
       termsIndex = FieldCache.DEFAULT.getTermsIndex(context.reader(), field);
-      valid = FieldCache.DEFAULT.getDocsWithField(context.reader(), field);
     } catch (RuntimeException e) {
       throw new DocTermsIndexException(field, e);
     }
@@ -59,7 +56,7 @@ public abstract class DocTermsIndexDocVa
 
   @Override
   public boolean exists(int doc) {
-    return valid.get(doc);
+    return ordVal(doc) >= 0;
   }
 
   @Override



Mime
View raw message