lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1031693 - in /lucene/java/branches/lucene_3_0: CHANGES.txt src/java/org/apache/lucene/index/CheckIndex.java
Date Fri, 05 Nov 2010 18:20:27 GMT
Author: mikemccand
Date: Fri Nov  5 18:20:27 2010
New Revision: 1031693

URL: http://svn.apache.org/viewvc?rev=1031693&view=rev
Log:
LUCENE-2744: only print number of fields w/ norms on 'test: norms....' CheckIndex output

Modified:
    lucene/java/branches/lucene_3_0/CHANGES.txt
    lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/index/CheckIndex.java

Modified: lucene/java/branches/lucene_3_0/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0/CHANGES.txt?rev=1031693&r1=1031692&r2=1031693&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0/CHANGES.txt (original)
+++ lucene/java/branches/lucene_3_0/CHANGES.txt Fri Nov  5 18:20:27 2010
@@ -75,6 +75,10 @@ Bug fixes
   is fixed to return null if there are no segments.  (Karthick
   Sankarachary via 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)
+
 Optimizations
 
 * LUCENE-2556: Improve memory usage after cloning TermAttribute.

Modified: lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/index/CheckIndex.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/index/CheckIndex.java?rev=1031693&r1=1031692&r2=1031693&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/index/CheckIndex.java (original)
+++ lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/index/CheckIndex.java Fri Nov
 5 18:20:27 2010
@@ -570,8 +570,10 @@ public class CheckIndex {
       }
       final byte[] b = new byte[reader.maxDoc()];
       for (final String fieldName : fieldNames) {
-        reader.norms(fieldName, b, 0);
-        ++status.totFields;
+        if (reader.hasNorms(fieldName)) {
+          reader.norms(fieldName, b, 0);
+          ++status.totFields;
+        }
       }
 
       msg("OK [" + status.totFields + " fields]");



Mime
View raw message