Lucene.Net.QueryParser.Classic.QueryParserBase.HandleBoost(): Changed implementation to use invariant culture to handle the decimal separator for boost since it apparently does that in Java
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/ee04a8c1 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/ee04a8c1 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/ee04a8c1 Branch: refs/heads/api-work Commit: ee04a8c1b57cfc603bb52e650e9a9e798526e0ae Parents: 6c707fe Author: Shad Storhaug <[email protected]> Authored: Tue Mar 7 19:52:25 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Tue Mar 7 19:52:25 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ee04a8c1/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs index 712dcf2..0ec2a54 100644 --- a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs +++ b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs @@ -877,7 +877,14 @@ namespace Lucene.Net.QueryParsers.Classic float f = (float)1.0; try { - f = float.Parse(boost.Image, Locale); + // LUCENENET NOTE: Apparently a "feature" of Lucene is to always + // use "." as the decimal specifier for boost, even if the culture uses + // a different one, such as ",". + + // LUCENENET TODO: It would probably be more intuitive to use + // the current Locale to specify the decimal identifier than + // to hard code it to be ".", but this would differ from Java Lucene. + f = float.Parse(boost.Image, CultureInfo.InvariantCulture); } catch (Exception /*ignored*/) {
