lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1143415 [4/4] - in /lucene/dev/trunk: lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/ lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/ lucene/contrib/memory/src/java/org/apache/lucene/in...
Date Wed, 06 Jul 2011 13:54:42 GMT
Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestBitVector.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestBitVector.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestBitVector.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestBitVector.java Wed Jul  6
13:54:38 2011
@@ -170,9 +170,10 @@ public class TestBitVector extends Lucen
       MockDirectoryWrapper d = new  MockDirectoryWrapper(random, new RAMDirectory());
       d.setPreventDoubleWrite(false);
       BitVector bv = new BitVector(size);
+      bv.invertAll();
       for (int i=0; i<count1; i++) {
-        bv.set(i);
-        assertEquals(i+1,bv.count());
+        bv.clear(i);
+        assertEquals(i+1,size-bv.count());
       }
       bv.write(d, "TESTBV");
       // gradually increase number of set bits
@@ -180,8 +181,8 @@ public class TestBitVector extends Lucen
         BitVector bv2 = new BitVector(d, "TESTBV");
         assertTrue(doCompare(bv,bv2));
         bv = bv2;
-        bv.set(i);
-        assertEquals(i+1,bv.count());
+        bv.clear(i);
+        assertEquals(i+1,size-bv.count());
         bv.write(d, "TESTBV");
       }
       // now start decreasing number of set bits
@@ -189,8 +190,8 @@ public class TestBitVector extends Lucen
         BitVector bv2 = new BitVector(d, "TESTBV");
         assertTrue(doCompare(bv,bv2));
         bv = bv2;
-        bv.clear(i);
-        assertEquals(i,bv.count());
+        bv.set(i);
+        assertEquals(i,size-bv.count());
         bv.write(d, "TESTBV");
       }
     }

Modified: lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestClassicAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestClassicAnalyzer.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestClassicAnalyzer.java
(original)
+++ lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestClassicAnalyzer.java
Wed Jul  6 13:54:38 2011
@@ -281,7 +281,7 @@ public class TestClassicAnalyzer extends
     // Make sure position is still incremented when
     // massive term is skipped:
     DocsAndPositionsEnum tps = MultiFields.getTermPositionsEnum(reader,
-                                                                MultiFields.getDeletedDocs(reader),
+                                                                MultiFields.getLiveDocs(reader),
                                                                 "content",
                                                                 new BytesRef("another"));
     assertTrue(tps.nextDoc() != DocsEnum.NO_MORE_DOCS);

Modified: lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java
(original)
+++ lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java
Wed Jul  6 13:54:38 2011
@@ -83,12 +83,12 @@ public class TestKeywordAnalyzer extends
 
     IndexReader reader = IndexReader.open(dir, true);
     DocsEnum td = MultiFields.getTermDocsEnum(reader,
-                                              MultiFields.getDeletedDocs(reader),
+                                              MultiFields.getLiveDocs(reader),
                                               "partnum",
                                               new BytesRef("Q36"));
     assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
     td = MultiFields.getTermDocsEnum(reader,
-                                     MultiFields.getDeletedDocs(reader),
+                                     MultiFields.getLiveDocs(reader),
                                      "partnum",
                                      new BytesRef("Q37"));
     assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);

Modified: lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java
(original)
+++ lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java
Wed Jul  6 13:54:38 2011
@@ -74,15 +74,15 @@ public class DeleteByPercentTask extends
     }
     while (numDeleted < numToDelete) {
       double delRate = ((double) (numToDelete-numDeleted))/r.numDocs();
-      Bits delDocs = MultiFields.getDeletedDocs(r);
+      Bits liveDocs = MultiFields.getLiveDocs(r);
       int doc = 0;
       while (doc < maxDoc && numDeleted < numToDelete) {
-        if ((delDocs == null || !delDocs.get(doc)) && random.nextDouble() <= delRate)
{
+        if ((liveDocs == null || liveDocs.get(doc)) && random.nextDouble() <=
delRate) {
           r.deleteDocument(doc);
           numDeleted++;
-          if (delDocs == null) {
-            delDocs = MultiFields.getDeletedDocs(r);
-            assert delDocs != null;
+          if (liveDocs == null) {
+            liveDocs = MultiFields.getLiveDocs(r);
+            assert liveDocs != null;
           }
         }
         doc++;

Modified: lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
(original)
+++ lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
Wed Jul  6 13:54:38 2011
@@ -96,9 +96,9 @@ public abstract class ReadTask extends P
     // optionally warm and add num docs traversed to count
     if (withWarm()) {
       Document doc = null;
-      Bits delDocs = MultiFields.getDeletedDocs(reader);
+      Bits liveDocs = MultiFields.getLiveDocs(reader);
       for (int m = 0; m < reader.maxDoc(); m++) {
-        if (null == delDocs || ! delDocs.get(m)) {
+        if (null == liveDocs || liveDocs.get(m)) {
           doc = reader.document(m);
           res += (doc == null ? 0 : 1);
         }

Modified: lucene/dev/trunk/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
(original)
+++ lucene/dev/trunk/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
Wed Jul  6 13:54:38 2011
@@ -487,7 +487,7 @@ public class TestPerfTasksLogic extends 
       TermsEnum terms = fields.terms();
       DocsEnum docs = null;
       while(terms.next() != null) {
-        docs = terms.docs(MultiFields.getDeletedDocs(reader), docs);
+        docs = terms.docs(MultiFields.getLiveDocs(reader), docs);
         while(docs.nextDoc() != docs.NO_MORE_DOCS) {
           totalTokenCount2 += docs.freq();
         }

Modified: lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/search/PayloadIterator.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/search/PayloadIterator.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/search/PayloadIterator.java
(original)
+++ lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/search/PayloadIterator.java
Wed Jul  6 13:54:38 2011
@@ -52,8 +52,8 @@ public class PayloadIterator {
       throws IOException {
     this.buffer = buffer;
     // TODO (Facet): avoid Multi*?
-    Bits deletedDocs = MultiFields.getDeletedDocs(indexReader);
-    this.tp = MultiFields.getTermPositionsEnum(indexReader, deletedDocs, term.field(), term.bytes());
+    Bits liveDocs = MultiFields.getLiveDocs(indexReader);
+    this.tp = MultiFields.getTermPositionsEnum(indexReader, liveDocs, term.field(), term.bytes());
   }
 
   /**

Modified: lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/search/sampling/TakmiSampleFixer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/search/sampling/TakmiSampleFixer.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/search/sampling/TakmiSampleFixer.java
(original)
+++ lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/search/sampling/TakmiSampleFixer.java
Wed Jul  6 13:54:38 2011
@@ -105,8 +105,8 @@ class TakmiSampleFixer implements Sample
 
     Term drillDownTerm = DrillDown.term(searchParams, catPath);
     // TODO (Facet): avoid Multi*?
-    Bits deletedDocs = MultiFields.getDeletedDocs(indexReader);
-    int updatedCount = countIntersection(MultiFields.getTermDocsEnum(indexReader, deletedDocs,
drillDownTerm.field(), drillDownTerm.bytes()),
+    Bits liveDocs = MultiFields.getLiveDocs(indexReader);
+    int updatedCount = countIntersection(MultiFields.getTermDocsEnum(indexReader, liveDocs,
drillDownTerm.field(), drillDownTerm.bytes()),
         docIds.iterator());
 
     fresNode.setValue(updatedCount);

Modified: lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/taxonomy/lucene/LuceneTaxonomyReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/taxonomy/lucene/LuceneTaxonomyReader.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/taxonomy/lucene/LuceneTaxonomyReader.java
(original)
+++ lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/taxonomy/lucene/LuceneTaxonomyReader.java
Wed Jul  6 13:54:38 2011
@@ -215,8 +215,8 @@ public class LuceneTaxonomyReader implem
     try {
       indexReaderLock.readLock().lock();
       // TODO (Facet): avoid Multi*?
-      Bits deletedDocs = MultiFields.getDeletedDocs(indexReader);
-      DocsEnum docs = MultiFields.getTermDocsEnum(indexReader, deletedDocs, Consts.FULL,
new BytesRef(path));
+      Bits liveDocs = MultiFields.getLiveDocs(indexReader);
+      DocsEnum docs = MultiFields.getTermDocsEnum(indexReader, liveDocs, Consts.FULL, new
BytesRef(path));
       if (docs != null && docs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
         ret = docs.docID();
       }

Modified: lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/taxonomy/lucene/LuceneTaxonomyWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/taxonomy/lucene/LuceneTaxonomyWriter.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/taxonomy/lucene/LuceneTaxonomyWriter.java
(original)
+++ lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/taxonomy/lucene/LuceneTaxonomyWriter.java
Wed Jul  6 13:54:38 2011
@@ -361,8 +361,8 @@ public class LuceneTaxonomyWriter implem
     }
 
     // TODO (Facet): avoid Multi*?
-    Bits deletedDocs = MultiFields.getDeletedDocs(reader);
-    DocsEnum docs = MultiFields.getTermDocsEnum(reader, deletedDocs, Consts.FULL, 
+    Bits liveDocs = MultiFields.getLiveDocs(reader);
+    DocsEnum docs = MultiFields.getTermDocsEnum(reader, liveDocs, Consts.FULL, 
         new BytesRef(categoryPath.toString(delimiter)));
     if (docs == null || docs.nextDoc() == DocIdSetIterator.NO_MORE_DOCS) {
       return -1; // category does not exist in taxonomy
@@ -397,8 +397,8 @@ public class LuceneTaxonomyWriter implem
     if (reader == null) {
       reader = openReader();
     }
-    Bits deletedDocs = MultiFields.getDeletedDocs(reader);
-    DocsEnum docs = MultiFields.getTermDocsEnum(reader, deletedDocs, Consts.FULL, 
+    Bits liveDocs = MultiFields.getLiveDocs(reader);
+    DocsEnum docs = MultiFields.getTermDocsEnum(reader, liveDocs, Consts.FULL, 
         new BytesRef(categoryPath.toString(delimiter, prefixLen)));
     if (docs == null || docs.nextDoc() == DocIdSetIterator.NO_MORE_DOCS) {
       return -1; // category does not exist in taxonomy
@@ -682,7 +682,7 @@ public class LuceneTaxonomyWriter implem
     // terms.
     if (terms != null) {
       TermsEnum termsEnum = terms.iterator();
-      Bits deletedDocs = MultiFields.getDeletedDocs(reader);
+      Bits liveDocs = MultiFields.getLiveDocs(reader);
       DocsEnum docsEnum = null;
       while (termsEnum.next() != null) {
         BytesRef t = termsEnum.term();
@@ -691,7 +691,7 @@ public class LuceneTaxonomyWriter implem
         // hence documents), there are no deletions in the index. Therefore, it
         // is sufficient to call next(), and then doc(), exactly once with no
         // 'validation' checks.
-        docsEnum = termsEnum.docs(deletedDocs, docsEnum);
+        docsEnum = termsEnum.docs(liveDocs, docsEnum);
         docsEnum.nextDoc();
         cp.clear();
         // TODO (Facet): avoid String creation/use bytes?
@@ -826,7 +826,7 @@ public class LuceneTaxonomyWriter implem
             // like Lucene's merge works, we hope there are few seeks.
             // TODO (Facet): is there a quicker way? E.g., not specifying the
             // next term by name every time?
-            otherdocsEnum[i] = othertes[i].docs(MultiFields.getDeletedDocs(otherreaders[i]),
otherdocsEnum[i]);
+            otherdocsEnum[i] = othertes[i].docs(MultiFields.getLiveDocs(otherreaders[i]),
otherdocsEnum[i]);
             otherdocsEnum[i].nextDoc(); // TODO (Facet): check?
             int origordinal = otherdocsEnum[i].docID();
             ordinalMaps[i].addMapping(origordinal, newordinal);
@@ -843,7 +843,7 @@ public class LuceneTaxonomyWriter implem
         // to be added because it already existed in the main taxonomy.
 
         // TODO (Facet): Again, is there a quicker way?
-        mainde = mainte.docs(MultiFields.getDeletedDocs(mainreader), mainde);
+        mainde = mainte.docs(MultiFields.getLiveDocs(mainreader), mainde);
         mainde.nextDoc(); // TODO (Facet): check?
         int newordinal = mainde.docID();
 
@@ -851,7 +851,7 @@ public class LuceneTaxonomyWriter implem
         for (int i=0; i<taxonomies.length; i++) {
           if (first.equals(currentOthers[i])) {
             // TODO (Facet): again, is there a quicker way?
-            otherdocsEnum[i] = othertes[i].docs(MultiFields.getDeletedDocs(otherreaders[i]),
otherdocsEnum[i]);
+            otherdocsEnum[i] = othertes[i].docs(MultiFields.getLiveDocs(otherreaders[i]),
otherdocsEnum[i]);
             otherdocsEnum[i].nextDoc(); // TODO (Facet): check?
             int origordinal = otherdocsEnum[i].docID();
             ordinalMaps[i].addMapping(origordinal, newordinal);

Modified: lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/taxonomy/lucene/ParentArray.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/taxonomy/lucene/ParentArray.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/taxonomy/lucene/ParentArray.java
(original)
+++ lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/taxonomy/lucene/ParentArray.java
Wed Jul  6 13:54:38 2011
@@ -102,8 +102,8 @@ class ParentArray {
 
     // Read the new part of the parents array from the positions:
     // TODO (Facet): avoid Multi*?
-    Bits deletedDocs = MultiFields.getDeletedDocs(indexReader);
-    DocsAndPositionsEnum positions = MultiFields.getTermPositionsEnum(indexReader, deletedDocs,
+    Bits liveDocs = MultiFields.getLiveDocs(indexReader);
+    DocsAndPositionsEnum positions = MultiFields.getTermPositionsEnum(indexReader, liveDocs,
         Consts.FIELD_PAYLOADS, new BytesRef(Consts.PAYLOAD_PARENT));
       if ((positions == null || positions.advance(first) == DocsAndPositionsEnum.NO_MORE_DOCS)
&& first < num) {
         throw new CorruptIndexException("Missing parent data for category " + first);

Modified: lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/util/ScoredDocIdsUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/util/ScoredDocIdsUtils.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/util/ScoredDocIdsUtils.java
(original)
+++ lucene/dev/trunk/modules/facet/src/java/org/apache/lucene/facet/util/ScoredDocIdsUtils.java
Wed Jul  6 13:54:38 2011
@@ -80,12 +80,12 @@ public class ScoredDocIdsUtils {
       return; // return immediately
     }
     
-    Bits bits = MultiFields.getDeletedDocs(reader);
+    Bits bits = MultiFields.getLiveDocs(reader);
 
     DocIdSetIterator it = set.iterator();
     int doc = DocIdSetIterator.NO_MORE_DOCS;
     while ((doc = it.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
-      if (bits.get(doc)) {
+      if (!bits.get(doc)) {
         set.fastClear(doc);
       }
     }
@@ -339,7 +339,7 @@ public class ScoredDocIdsUtils {
         @Override
         public DocIdSetIterator iterator() throws IOException {
           return new DocIdSetIterator() {
-            final Bits deletedDocs = MultiFields.getDeletedDocs(reader);
+            final Bits liveDocs = MultiFields.getLiveDocs(reader);
             private int next = -1;
 
             @Override
@@ -359,7 +359,7 @@ public class ScoredDocIdsUtils {
             public int nextDoc() throws IOException {
               do {
                 ++next;
-              } while (next < maxDoc && deletedDocs != null && deletedDocs.get(next));
+              } while (next < maxDoc && liveDocs != null && !liveDocs.get(next));
 
               return next < maxDoc ? next : NO_MORE_DOCS;
             }

Modified: lucene/dev/trunk/modules/facet/src/test/org/apache/lucene/facet/FacetTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/facet/src/test/org/apache/lucene/facet/FacetTestBase.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/facet/src/test/org/apache/lucene/facet/FacetTestBase.java (original)
+++ lucene/dev/trunk/modules/facet/src/test/org/apache/lucene/facet/FacetTestBase.java Wed
Jul  6 13:54:38 2011
@@ -266,11 +266,11 @@ public abstract class FacetTestBase exte
       if (terms == null) {
         continue;
       }
-      Bits deletedDocs = MultiFields.getDeletedDocs(indexReader);
+      Bits liveDocs = MultiFields.getLiveDocs(indexReader);
       TermsEnum te = terms.iterator();
       DocsEnum de = null;
       while (te.next() != null) {
-        de = te.docs(deletedDocs, de);
+        de = te.docs(liveDocs, de);
         int cnt = 0;
         while (de.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
           cnt++;

Modified: lucene/dev/trunk/modules/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java
(original)
+++ lucene/dev/trunk/modules/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java
Wed Jul  6 13:54:38 2011
@@ -91,7 +91,7 @@ public class TestMultipleCategoryLists e
     // Obtain facets results and hand-test them
     assertCorrectResults(facetsCollector);
 
-    DocsEnum td = MultiFields.getTermDocsEnum(ir, MultiFields.getDeletedDocs(ir), "$facets",
new BytesRef("$fulltree$"));
+    DocsEnum td = MultiFields.getTermDocsEnum(ir, MultiFields.getLiveDocs(ir), "$facets",
new BytesRef("$fulltree$"));
     assertTrue(td.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
 
     tr.close();

Modified: lucene/dev/trunk/modules/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java
(original)
+++ lucene/dev/trunk/modules/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java
Wed Jul  6 13:54:38 2011
@@ -158,12 +158,12 @@ public class TestScoredDocIDsUtils exten
       // now make sure the documents in the complement set are not deleted
       // and not in the original result set
       ScoredDocIDsIterator compIterator = complementSet.iterator();
-      Bits deleted = MultiFields.getDeletedDocs(reader);
+      Bits live = MultiFields.getLiveDocs(reader);
       while (compIterator.next()) {
         int docNum = compIterator.getDocID();
         assertFalse(
             "Complement-Set must not contain deleted documents (doc="+docNum+")",
-            deleted != null && deleted.get(docNum));
+            live != null && !live.get(docNum));
         assertNull(
             "Complement-Set must not contain docs from the original set (doc="+ docNum+")",
             reader.document(docNum).getFieldable("del"));

Modified: lucene/dev/trunk/modules/queries/src/java/org/apache/lucene/queries/function/FunctionQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/queries/src/java/org/apache/lucene/queries/function/FunctionQuery.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/queries/src/java/org/apache/lucene/queries/function/FunctionQuery.java
(original)
+++ lucene/dev/trunk/modules/queries/src/java/org/apache/lucene/queries/function/FunctionQuery.java
Wed Jul  6 13:54:38 2011
@@ -112,7 +112,7 @@ public class FunctionQuery extends Query
     int doc=-1;
     final DocValues vals;
     final boolean hasDeletions;
-    final Bits delDocs;
+    final Bits liveDocs;
 
     public AllScorer(AtomicReaderContext context, FunctionWeight w) throws IOException {
       super(w);
@@ -121,8 +121,8 @@ public class FunctionQuery extends Query
       this.reader = context.reader;
       this.maxDoc = reader.maxDoc();
       this.hasDeletions = reader.hasDeletions();
-      this.delDocs = MultiFields.getDeletedDocs(reader);
-      assert !hasDeletions || delDocs != null;
+      this.liveDocs = MultiFields.getLiveDocs(reader);
+      assert !hasDeletions || liveDocs != null;
       vals = func.getValues(weight.context, context);
     }
 
@@ -142,7 +142,7 @@ public class FunctionQuery extends Query
         if (doc>=maxDoc) {
           return doc=NO_MORE_DOCS;
         }
-        if (hasDeletions && delDocs.get(doc)) continue;
+        if (hasDeletions && !liveDocs.get(doc)) continue;
         return doc;
       }
     }

Modified: lucene/dev/trunk/modules/queries/src/java/org/apache/lucene/queries/function/ValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/queries/src/java/org/apache/lucene/queries/function/ValueSource.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/queries/src/java/org/apache/lucene/queries/function/ValueSource.java
(original)
+++ lucene/dev/trunk/modules/queries/src/java/org/apache/lucene/queries/function/ValueSource.java
Wed Jul  6 13:54:38 2011
@@ -191,5 +191,3 @@ public abstract class ValueSource implem
     }
   }
 }
-
-

Modified: lucene/dev/trunk/modules/queries/src/java/org/apache/lucene/queries/function/ValueSourceScorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/queries/src/java/org/apache/lucene/queries/function/ValueSourceScorer.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/modules/queries/src/java/org/apache/lucene/queries/function/ValueSourceScorer.java
(original)
+++ lucene/dev/trunk/modules/queries/src/java/org/apache/lucene/queries/function/ValueSourceScorer.java
Wed Jul  6 13:54:38 2011
@@ -30,7 +30,7 @@ public class ValueSourceScorer extends S
   protected final int maxDoc;
   protected final DocValues values;
   protected boolean checkDeletes;
-  private final Bits delDocs;
+  private final Bits liveDocs;
 
   protected ValueSourceScorer(IndexReader reader, DocValues values) {
     super(null);
@@ -38,7 +38,7 @@ public class ValueSourceScorer extends S
     this.maxDoc = reader.maxDoc();
     this.values = values;
     setCheckDeletes(true);
-    this.delDocs = MultiFields.getDeletedDocs(reader);
+    this.liveDocs = MultiFields.getLiveDocs(reader);
   }
 
   public IndexReader getReader() {
@@ -50,7 +50,7 @@ public class ValueSourceScorer extends S
   }
 
   public boolean matches(int doc) {
-    return (!checkDeletes || !delDocs.get(doc)) && matchesValue(doc);
+    return (!checkDeletes || liveDocs.get(doc)) && matchesValue(doc);
   }
 
   public boolean matchesValue(int doc) {

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/request/SimpleFacets.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/request/SimpleFacets.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/request/SimpleFacets.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/request/SimpleFacets.java Wed Jul  6 13:54:38
2011
@@ -673,7 +673,7 @@ public class SimpleFacets {
             if (deState==null) {
               deState = new SolrIndexSearcher.DocsEnumState();
               deState.fieldName = field;
-              deState.deletedDocs = MultiFields.getDeletedDocs(r);
+              deState.liveDocs = MultiFields.getLiveDocs(r);
               deState.termsEnum = termsEnum;
               deState.docsEnum = docsEnum;
             }

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/schema/LatLonType.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/schema/LatLonType.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/schema/LatLonType.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/schema/LatLonType.java Wed Jul  6 13:54:38
2011
@@ -389,7 +389,7 @@ class SpatialDistanceQuery extends Query
     int doc=-1;
     final DocValues latVals;
     final DocValues lonVals;
-    final Bits delDocs;
+    final Bits liveDocs;
 
 
     final double lonMin, lonMax, lon2Min, lon2Max, latMin, latMax;
@@ -411,7 +411,7 @@ class SpatialDistanceQuery extends Query
       this.qWeight = w.getValue();
       this.reader = readerContext.reader;
       this.maxDoc = reader.maxDoc();
-      this.delDocs = reader.getDeletedDocs();
+      this.liveDocs = reader.getLiveDocs();
       latVals = latSource.getValues(weight.latContext, readerContext);
       lonVals = lonSource.getValues(weight.lonContext, readerContext);
 
@@ -489,7 +489,7 @@ class SpatialDistanceQuery extends Query
         if (doc>=maxDoc) {
           return doc=NO_MORE_DOCS;
         }
-        if (delDocs != null && delDocs.get(doc)) continue;
+        if (liveDocs != null && !liveDocs.get(doc)) continue;
         if (!match()) continue;
         return doc;
       }

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/JoinQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/JoinQParserPlugin.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/JoinQParserPlugin.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/JoinQParserPlugin.java Wed Jul 
6 13:54:38 2011
@@ -285,19 +285,19 @@ class JoinQuery extends Query {
         }
       }
 
-      Bits fromDeletedDocs = MultiFields.getDeletedDocs(fromSearcher.getIndexReader());
-      Bits toDeletedDocs = fromSearcher == toSearcher ? fromDeletedDocs : MultiFields.getDeletedDocs(toSearcher.getIndexReader());
+      Bits fromLiveDocs = MultiFields.getLiveDocs(fromSearcher.getIndexReader());
+      Bits toLiveDocs = fromSearcher == toSearcher ? fromLiveDocs : MultiFields.getLiveDocs(toSearcher.getIndexReader());
 
       fromDeState = new SolrIndexSearcher.DocsEnumState();
       fromDeState.fieldName = fromField;
-      fromDeState.deletedDocs = fromDeletedDocs;
+      fromDeState.liveDocs = fromLiveDocs;
       fromDeState.termsEnum = termsEnum;
       fromDeState.docsEnum = null;
       fromDeState.minSetSizeCached = minDocFreqFrom;
 
       toDeState = new SolrIndexSearcher.DocsEnumState();
       toDeState.fieldName = toField;
-      toDeState.deletedDocs = toDeletedDocs;
+      toDeState.liveDocs = toLiveDocs;
       toDeState.termsEnum = toTermsEnum;
       toDeState.docsEnum = null;
       toDeState.minSetSizeCached = minDocFreqTo;
@@ -314,7 +314,7 @@ class JoinQuery extends Query {
 
         if (freq < minDocFreqFrom) {
           fromTermDirectCount++;
-          // OK to skip deletedDocs, since we check for intersection with docs matching query
+          // OK to skip liveDocs, since we check for intersection with docs matching query
           fromDeState.docsEnum = fromDeState.termsEnum.docs(null, fromDeState.docsEnum);
           DocsEnum docsEnum = fromDeState.docsEnum;
 
@@ -393,8 +393,8 @@ class JoinQuery extends Query {
             } else {
               toTermDirectCount++;
 
-              // need to use deletedDocs here so we don't map to any deleted ones
-              toDeState.docsEnum = toDeState.termsEnum.docs(toDeState.deletedDocs, toDeState.docsEnum);
+              // need to use liveDocs here so we don't map to any deleted ones
+              toDeState.docsEnum = toDeState.termsEnum.docs(toDeState.liveDocs, toDeState.docsEnum);
               DocsEnum docsEnum = toDeState.docsEnum;              
 
               if (docsEnum instanceof MultiDocsEnum) {

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java?rev=1143415&r1=1143414&r2=1143415&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java Wed Jul 
6 13:54:38 2011
@@ -493,7 +493,7 @@ public class SolrIndexSearcher extends I
     Terms terms = fields.terms(t.field());
     if (terms == null) return -1;
     BytesRef termBytes = t.bytes();
-    DocsEnum docs = terms.docs(MultiFields.getDeletedDocs(reader), termBytes, null);
+    DocsEnum docs = terms.docs(MultiFields.getLiveDocs(reader), termBytes, null);
     if (docs == null) return -1;
     int id = docs.nextDoc();
     return id == DocIdSetIterator.NO_MORE_DOCS ? -1 : id;
@@ -646,12 +646,12 @@ public class SolrIndexSearcher extends I
       }
 
       collector.setNextReader(leaf);
-      Bits skipDocs = reader.getDeletedDocs();
+      Bits liveDocs = reader.getLiveDocs();
       int max = reader.maxDoc();
 
       if (idIter == null) {
         for (int docid = 0; docid<max; docid++) {
-          if (skipDocs != null && skipDocs.get(docid)) continue;
+          if (liveDocs != null && !liveDocs.get(docid)) continue;
           collector.collect(docid);
         }
       } else {
@@ -795,7 +795,7 @@ public class SolrIndexSearcher extends I
     int bitsSet = 0;
     OpenBitSet obs = null;
 
-    DocsEnum docsEnum = deState.termsEnum.docs(deState.deletedDocs, deState.docsEnum);
+    DocsEnum docsEnum = deState.termsEnum.docs(deState.liveDocs, deState.docsEnum);
     if (deState.docsEnum == null) {
       deState.docsEnum = docsEnum;
     }
@@ -884,8 +884,8 @@ public class SolrIndexSearcher extends I
           Terms terms = fields.terms(t.field());
           BytesRef termBytes = t.bytes();
           
-          Bits skipDocs = reader.getDeletedDocs();
-          DocsEnum docsEnum = terms==null ? null : terms.docs(skipDocs, termBytes, null);
+          Bits liveDocs = reader.getLiveDocs();
+          DocsEnum docsEnum = terms==null ? null : terms.docs(liveDocs, termBytes, null);
 
           if (docsEnum != null) {
             DocsEnum.BulkReadResult readResult = docsEnum.getBulkResult();
@@ -1727,7 +1727,7 @@ public class SolrIndexSearcher extends I
   public static class DocsEnumState {
     public String fieldName;  // currently interned for as long as lucene requires it
     public TermsEnum termsEnum;
-    public Bits deletedDocs;
+    public Bits liveDocs;
     public DocsEnum docsEnum;
 
     public int minSetSizeCached;

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=1143415&r1=1143414&r2=1143415&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 Wed
Jul  6 13:54:38 2011
@@ -245,7 +245,7 @@ public class FileFloatSource extends Val
       DocsEnum docsEnum = null;
 
       // removing deleted docs shouldn't matter
-      // final Bits delDocs = MultiFields.getDeletedDocs(reader);
+      // final Bits liveDocs = MultiFields.getLiveDocs(reader);
 
       for (String line; (line=r.readLine())!=null;) {
         int delimIndex = line.indexOf(delimiter);



Mime
View raw message