lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r911566 - /lucene/lucene.net/trunk/C#/src/Lucene.Net/Search/Query.cs
Date Thu, 18 Feb 2010 20:43:55 GMT
Author: digy
Date: Thu Feb 18 20:43:55 2010
New Revision: 911566

URL: http://svn.apache.org/viewvc?rev=911566&view=rev
Log:
Another Fix for 2.9.2 (rev: 911552) --> LUCENE-2770: fix query normalization when boosts
of all clauses==0

Modified:
    lucene/lucene.net/trunk/C#/src/Lucene.Net/Search/Query.cs

Modified: lucene/lucene.net/trunk/C#/src/Lucene.Net/Search/Query.cs
URL: http://svn.apache.org/viewvc/lucene/lucene.net/trunk/C%23/src/Lucene.Net/Search/Query.cs?rev=911566&r1=911565&r2=911566&view=diff
==============================================================================
--- lucene/lucene.net/trunk/C#/src/Lucene.Net/Search/Query.cs (original)
+++ lucene/lucene.net/trunk/C#/src/Lucene.Net/Search/Query.cs Thu Feb 18 20:43:55 2010
@@ -104,6 +104,8 @@
 			Weight weight = query.CreateWeight(searcher);
 			float sum = weight.SumOfSquaredWeights();
 			float norm = GetSimilarity(searcher).QueryNorm(sum);
+            if (float.IsInfinity(norm) || float.IsNaN(norm))
+                norm = 1.0f;
 			weight.Normalize(norm);
 			return weight;
 		}



Mime
View raw message