You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2011/07/17 14:10:18 UTC

svn commit: r1147590 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/backwards/ lucene/backwards/src/test-framework/ lucene/backwards/src/test/ lucene/src/java/org/apache/lucene/index/CheckIndex.java solr/

Author: mikemccand
Date: Sun Jul 17 12:10:17 2011
New Revision: 1147590

URL: http://svn.apache.org/viewvc?rev=1147590&view=rev
Log:
always check skipping for terms, not just if dF > 16

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/lucene/   (props changed)
    lucene/dev/branches/branch_3x/lucene/backwards/   (props changed)
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/   (props changed)
    lucene/dev/branches/branch_3x/lucene/backwards/src/test-framework/   (props changed)
    lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/CheckIndex.java
    lucene/dev/branches/branch_3x/solr/   (props changed)

Modified: lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/CheckIndex.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/CheckIndex.java?rev=1147590&r1=1147589&r2=1147590&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/CheckIndex.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/CheckIndex.java Sun Jul 17 12:10:17 2011
@@ -666,7 +666,6 @@ public class CheckIndex {
 
       final TermEnum termEnum = reader.terms();
       final TermPositions termPositions = reader.termPositions();
-      final int postingsSkipInterval = reader.getPostingsSkipInterval();
 
       // Used only to count up # deleted docs for this term
       final MySegmentTermDocs myTermDocs = new MySegmentTermDocs(reader);
@@ -709,43 +708,40 @@ public class CheckIndex {
         }
 
         // Test skipping
-        if (docFreq >= postingsSkipInterval) {
-          
-          for(int idx=0;idx<7;idx++) {
-            final int skipDocID = (int) (((idx+1)*(long) maxDoc)/8);
-            termPositions.seek(term);
-            if (!termPositions.skipTo(skipDocID)) {
-              break;
-            } else {
-
-              final int docID = termPositions.doc();
-              if (docID < skipDocID) {
-                throw new RuntimeException("term " + term + ": skipTo(docID=" + skipDocID + ") returned docID=" + docID);
+        for(int idx=0;idx<7;idx++) {
+          final int skipDocID = (int) (((idx+1)*(long) maxDoc)/8);
+          termPositions.seek(term);
+          if (!termPositions.skipTo(skipDocID)) {
+            break;
+          } else {
+
+            final int docID = termPositions.doc();
+            if (docID < skipDocID) {
+              throw new RuntimeException("term " + term + ": skipTo(docID=" + skipDocID + ") returned docID=" + docID);
+            }
+            final int freq = termPositions.freq();
+            if (freq <= 0) {
+              throw new RuntimeException("termFreq " + freq + " is out of bounds");
+            }
+            int lastPosition = -1;
+            for(int posUpto=0;posUpto<freq;posUpto++) {
+              final int pos = termPositions.nextPosition();
+              if (pos < 0) {
+                throw new RuntimeException("position " + pos + " is out of bounds");
               }
-              final int freq = termPositions.freq();
-              if (freq <= 0) {
-                throw new RuntimeException("termFreq " + freq + " is out of bounds");
+              // TODO: we should assert when all pos == 0 that positions are actually omitted
+              if (pos < lastPosition) {
+                throw new RuntimeException("position " + pos + " is < lastPosition " + lastPosition);
               }
-              int lastPosition = -1;
-              for(int posUpto=0;posUpto<freq;posUpto++) {
-                final int pos = termPositions.nextPosition();
-                if (pos < 0) {
-                  throw new RuntimeException("position " + pos + " is out of bounds");
-                }
-                // TODO: we should assert when all pos == 0 that positions are actually omitted
-                if (pos < lastPosition) {
-                  throw new RuntimeException("position " + pos + " is < lastPosition " + lastPosition);
-                }
-                lastPosition = pos;
-              } 
+              lastPosition = pos;
+            } 
 
-              if (!termPositions.next()) {
-                break;
-              }
-              final int nextDocID = termPositions.doc();
-              if (nextDocID <= docID) {
-                throw new RuntimeException("term " + term + ": skipTo(docID=" + skipDocID + "), then .next() returned docID=" + nextDocID + " vs prev docID=" + docID);
-              }
+            if (!termPositions.next()) {
+              break;
+            }
+            final int nextDocID = termPositions.doc();
+            if (nextDocID <= docID) {
+              throw new RuntimeException("term " + term + ": skipTo(docID=" + skipDocID + "), then .next() returned docID=" + nextDocID + " vs prev docID=" + docID);
             }
           }
         }