lucene-java-commits mailing list archives

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

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

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

Modified: lucene/java/branches/lucene_2_9/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/CHANGES.txt?rev=1031696&r1=1031695&r2=1031696&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/CHANGES.txt (original)
+++ lucene/java/branches/lucene_2_9/CHANGES.txt Fri Nov  5 18:21:29 2010
@@ -77,6 +77,10 @@ Bug fixes
 
 * LUCENE-2730: Fix two rare deadlock cases in IndexWriter (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_2_9/src/java/org/apache/lucene/index/CheckIndex.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/index/CheckIndex.java?rev=1031696&r1=1031695&r2=1031696&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/index/CheckIndex.java (original)
+++ lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/index/CheckIndex.java Fri Nov
 5 18:21:29 2010
@@ -593,8 +593,10 @@ public class CheckIndex {
       final byte[] b = new byte[reader.maxDoc()];
       while (it.hasNext()) {
         final String fieldName = (String) it.next();
-        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