diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 4f459c3097c..4ea46fc18b5 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -614,6 +614,10 @@ Bug fixes fields 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 weight diff --git a/lucene/src/java/org/apache/lucene/index/CheckIndex.java b/lucene/src/java/org/apache/lucene/index/CheckIndex.java index 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; }