lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [05/26] lucenenet git commit: BUG: Lucene.Net.QueryParser.Xml.Builders.NumericRangeQueryBuilder: Fixed numeric parsing to use invariant culture
Date Wed, 08 Mar 2017 18:23:41 GMT
BUG: Lucene.Net.QueryParser.Xml.Builders.NumericRangeQueryBuilder: Fixed numeric parsing to
use invariant culture


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/4a073137
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/4a073137
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/4a073137

Branch: refs/heads/api-work
Commit: 4a0731371317b082a43c8ec57948c3a67c5538bb
Parents: e316765
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Wed Mar 8 00:25:42 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Wed Mar 8 00:25:42 2017 +0700

----------------------------------------------------------------------
 .../Xml/Builders/NumericRangeQueryBuilder.cs                | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4a073137/src/Lucene.Net.QueryParser/Xml/Builders/NumericRangeQueryBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Xml/Builders/NumericRangeQueryBuilder.cs b/src/Lucene.Net.QueryParser/Xml/Builders/NumericRangeQueryBuilder.cs
index 668f56e..80f1bae 100644
--- a/src/Lucene.Net.QueryParser/Xml/Builders/NumericRangeQueryBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Xml/Builders/NumericRangeQueryBuilder.cs
@@ -1,6 +1,7 @@
 ´╗┐using Lucene.Net.Search;
 using Lucene.Net.Util;
 using System;
+using System.Globalization;
 using System.Xml;
 
 namespace Lucene.Net.QueryParsers.Xml.Builders
@@ -100,25 +101,25 @@ namespace Lucene.Net.QueryParsers.Xml.Builders
                 if (type.Equals("int", StringComparison.OrdinalIgnoreCase))
                 {
                     filter = NumericRangeQuery.NewInt32Range(field, precisionStep, Convert
-                        .ToInt32(lowerTerm), Convert.ToInt32(upperTerm), lowerInclusive,
+                        .ToInt32(lowerTerm, CultureInfo.InvariantCulture), Convert.ToInt32(upperTerm,
CultureInfo.InvariantCulture), lowerInclusive,
                         upperInclusive);
                 }
                 else if (type.Equals("long", StringComparison.OrdinalIgnoreCase))
                 {
                     filter = NumericRangeQuery.NewInt64Range(field, precisionStep, Convert
-                        .ToInt64(lowerTerm), Convert.ToInt64(upperTerm), lowerInclusive,
+                        .ToInt64(lowerTerm, CultureInfo.InvariantCulture), Convert.ToInt64(upperTerm,
CultureInfo.InvariantCulture), lowerInclusive,
                         upperInclusive);
                 }
                 else if (type.Equals("double", StringComparison.OrdinalIgnoreCase))
                 {
                     filter = NumericRangeQuery.NewDoubleRange(field, precisionStep, Convert
-                        .ToDouble(lowerTerm), Convert.ToDouble(upperTerm), lowerInclusive,
+                        .ToDouble(lowerTerm, CultureInfo.InvariantCulture), Convert.ToDouble(upperTerm,
CultureInfo.InvariantCulture), lowerInclusive,
                         upperInclusive);
                 }
                 else if (type.Equals("float", StringComparison.OrdinalIgnoreCase))
                 {
                     filter = NumericRangeQuery.NewSingleRange(field, precisionStep, Convert
-                        .ToSingle(lowerTerm), Convert.ToSingle(upperTerm), lowerInclusive,
+                        .ToSingle(lowerTerm, CultureInfo.InvariantCulture), Convert.ToSingle(upperTerm,
CultureInfo.InvariantCulture), lowerInclusive,
                         upperInclusive);
                 }
                 else


Mime
View raw message