lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r911153 - /lucene/solr/trunk/src/java/org/apache/solr/search/function/distance/DistanceUtils.java
Date Wed, 17 Feb 2010 19:26:11 GMT
Author: shalin
Date: Wed Feb 17 19:26:11 2010
New Revision: 911153

URL: http://svn.apache.org/viewvc?rev=911153&view=rev
Log:
SOLR-1302 -- Fixing infinite norm calculation

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/search/function/distance/DistanceUtils.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/search/function/distance/DistanceUtils.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/search/function/distance/DistanceUtils.java?rev=911153&r1=911152&r2=911153&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/search/function/distance/DistanceUtils.java
(original)
+++ lucene/solr/trunk/src/java/org/apache/solr/search/function/distance/DistanceUtils.java
Wed Feb 17 19:26:11 2010
@@ -70,7 +70,7 @@
       result = Math.sqrt(squaredEuclideanDistance(vec1, vec2));
     } else if (power == Integer.MAX_VALUE || Double.isInfinite(power)) {//infininte norm?
       for (int i = 0; i < vec1.length; i++) {
-        result = Math.max(vec1[i], vec2[i]);
+        result = Math.max(result, Math.max(vec1[i], vec2[i]));
       }
     } else {
       for (int i = 0; i < vec1.length; i++) {



Mime
View raw message