Apache Lucene open-source search software
LUCENE-2744: only print number of fields w/ norms on 'test: norms....' CheckIndex output
Michael McCandlesse83d2c63bb10
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txtindex 4f459c3097c..4ea46fc18b5 100644--- a/lucene/CHANGES.txt+++ b/lucene/CHANGES.txt@@ -614,6 +614,10 @@ Bug fixesfields could lead to invalid ArrayIndexOutOfBoundsExceptions.(Robert Muir, Mike McCandless)+* LUCENE-2744: CheckIndex was stating total number of fields,+ not the number that have norms enabled, on the "test: field+ norms..." output. (Mark Kristensson via Mike McCandless)+New features* LUCENE-2128: Parallelized fetching document frequencies during weightdiff --git a/lucene/src/java/org/apache/lucene/index/CheckIndex.java b/lucene/src/java/org/apache/lucene/index/CheckIndex.javaindex 01274beaf34..4656001c120 100644--- a/lucene/src/java/org/apache/lucene/index/CheckIndex.java+++ b/lucene/src/java/org/apache/lucene/index/CheckIndex.java@@ -550,7 +550,9 @@ public class CheckIndex {}final byte[] b = new byte[reader.maxDoc()];for (final String fieldName : fieldNames) {- reader.norms(fieldName, b, 0);+ if (reader.hasNorms(fieldName)) {+ reader.norms(fieldName, b, 0);+ }++status.totFields;}