You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2016/10/23 13:02:27 UTC
[41/50] [abbrv] lucenenet git commit: Fixed hash code value and
ToString() bug in Queries.CommonTermsQuery
Fixed hash code value and ToString() bug in Queries.CommonTermsQuery
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/8c20d3fd
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/8c20d3fd
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/8c20d3fd
Branch: refs/heads/master
Commit: 8c20d3fdfa7ede98f0116351775dd5ce8d138214
Parents: 1fe048c
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Sun Oct 23 18:00:47 2016 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Sun Oct 23 19:36:48 2016 +0700
----------------------------------------------------------------------
src/Lucene.Net.Queries/CommonTermsQuery.cs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8c20d3fd/src/Lucene.Net.Queries/CommonTermsQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/CommonTermsQuery.cs b/src/Lucene.Net.Queries/CommonTermsQuery.cs
index dae7292..62e7cd8 100644
--- a/src/Lucene.Net.Queries/CommonTermsQuery.cs
+++ b/src/Lucene.Net.Queries/CommonTermsQuery.cs
@@ -1,6 +1,7 @@
\ufeffusing System;
using System.Collections.Generic;
using System.Diagnostics;
+using System.Globalization;
using System.Linq;
using System.Text;
using Lucene.Net.Index;
@@ -375,8 +376,8 @@ namespace Lucene.Net.Queries
{
buffer.Append('~');
buffer.Append("(");
- buffer.Append(LowFreqMinimumNumberShouldMatch);
- buffer.Append(HighFreqMinimumNumberShouldMatch);
+ buffer.AppendFormat(CultureInfo.InvariantCulture, "{0:0.0#######}", LowFreqMinimumNumberShouldMatch);
+ buffer.AppendFormat(CultureInfo.InvariantCulture, "{0:0.0#######}", HighFreqMinimumNumberShouldMatch);
buffer.Append(")");
}
if (Boost != 1.0f)
@@ -398,7 +399,7 @@ namespace Lucene.Net.Queries
result = prime * result + Number.FloatToIntBits(maxTermFrequency);
result = prime * result + Number.FloatToIntBits(LowFreqMinimumNumberShouldMatch);
result = prime * result + Number.FloatToIntBits(HighFreqMinimumNumberShouldMatch);
- result = prime * result + ((terms == null) ? 0 : terms.GetHashCode());
+ result = prime * result + ((terms == null) ? 0 : terms.GetValueHashCode());
return result;
}