lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1363379 - /lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java
Date Thu, 19 Jul 2012 15:21:13 GMT
Author: rmuir
Date: Thu Jul 19 15:21:12 2012
New Revision: 1363379

URL: http://svn.apache.org/viewvc?rev=1363379&view=rev
Log:
don't divide by 0 in the checkindex status: it totally confuses people to see the \uFFFD for
the NaN

Modified:
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java?rev=1363379&r1=1363378&r2=1363379&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java Thu Jul
19 15:21:12 2012
@@ -1601,8 +1601,9 @@ public class CheckIndex {
           }
         }
       }
+      float vectorAvg = status.docCount == 0 ? 0 : status.totVectors / (float)status.docCount;
       msg("OK [" + status.totVectors + " total vector count; avg " + 
-          format.format((((float) status.totVectors) / status.docCount)) + " term/freq vector
fields per doc]");
+          format.format(vectorAvg) + " term/freq vector fields per doc]");
     } catch (Throwable e) {
       msg("ERROR [" + String.valueOf(e.getMessage()) + "]");
       status.error = e;



Mime
View raw message