Apache Lucene open-source search software
LUCENE-5879: turn off too-slow term range checking for now
Michael McCandless2418769c8574
diff --git a/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java b/lucene/core/src/java/org/apache/lucene/index/CheckIndex.javaindex 09898991124..e69fad1e3a3 100644--- a/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java+++ b/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java@@ -928,6 +928,7 @@ public class CheckIndex implements Closeable {if (isIntersect == false) {throw new RuntimeException("didn't see max term field=" + field + " term=" + maxTerm);}+ //System.out.println(" terms=" + termCount);return termCount;}@@ -954,6 +955,7 @@ public class CheckIndex implements Closeable {int cmp = term.compareTo(maxTerm);if (cmp == 0) {// Done!+ //System.out.println(" terms=" + termCount);return termCount;} else if (cmp > 0) {throw new RuntimeException("didn't see end term field=" + field + " term=" + maxTerm);@@ -988,7 +990,8 @@ public class CheckIndex implements Closeable {/** Test Terms.intersect on this range, and validates that it returns the same doc ids as using non-intersect TermsEnum. Returns true if* any fake terms were seen. */private static boolean checkSingleTermRange(String field, int maxDoc, Terms terms, BytesRef minTerm, BytesRef maxTerm, FixedBitSet normalDocs, FixedBitSet intersectDocs) throws IOException {- // System.out.println(" check minTerm=" + minTerm + " maxTerm=" + maxTerm);+ //System.out.println(" check minTerm=" + minTerm.utf8ToString() + " maxTerm=" + maxTerm.utf8ToString());+ assert minTerm.compareTo(maxTerm) <= 0;TermsEnum termsEnum = terms.iterator(null);TermsEnum.SeekStatus status = termsEnum.seekCeil(minTerm);@@ -1009,6 +1012,7 @@ public class CheckIndex implements Closeable {if (normalDocs.equals(intersectDocs) == false) {throw new RuntimeException("intersect visited different docs than straight terms enum: " + normalDocs.cardinality() + " for straight enum, vs " + intersectDocs.cardinality() + " for intersect, minTerm=" + minTerm + " maxTerm=" + maxTerm);}+ //System.out.println(" docs=" + normalTermCount);//System.out.println(" " + intersectTermCount + " vs " + normalTermCount);return intersectTermCount != normalTermCount;}@@ -1069,6 +1073,7 @@ public class CheckIndex implements Closeable {lastTerm.copyBytes(term);}}+ //System.out.println(" count=" + termCount);if (lastTerm != null && termBounds.isEmpty() == false) {BytesRef minTerm = termBounds.removeFirst();@@ -1506,7 +1511,8 @@ public class CheckIndex implements Closeable {long fieldTermCount = (status.delTermCount+status.termCount)-termCountStart;- if (hasFreqs == false) {+ // LUCENE-5879: this is just too slow for now:+ if (false && hasFreqs == false) {// For DOCS_ONLY fields we recursively test term ranges:checkTermRanges(field, maxDoc, fieldTerms, fieldTermCount);}