Fix query parser failure with Unicode minus sign, #846#1205
Merged
NightOwl888 merged 2 commits intoapache:masterfrom Oct 6, 2025
Merged
Fix query parser failure with Unicode minus sign, #846#1205NightOwl888 merged 2 commits intoapache:masterfrom
NightOwl888 merged 2 commits intoapache:masterfrom
Conversation
NightOwl888
requested changes
Oct 6, 2025
src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs
Outdated
Show resolved
Hide resolved
…tInclusiveNumericRange_UnicodeMinus(): Use CultureContext to ensure the temporary culture assigned to the current thread is reverted at the end of the test.
NightOwl888
approved these changes
Oct 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix query parser failure with Unicode minus sign in exponential notation.
Fixes #846
Description
Some cultures such as sv-FI use a Unicode minus sign instead of a hyphen as the negative sign. When this is in the exponential notation (i.e.
1.0E-20), this can cause the numeric query parser to fail, and it was causing some flaky test failures. This bug was fixed in J2N 2.2.0-alpha-0026 (see NightOwl888/J2N#128). This PR upgrades J2N to this version, and adds a unit test confirming the fix. (If you're interested in validating, you can downgrade J2N in this branch to 2.2.0-alpha-0021 and see that the test fails.)This is the last remaining failure on #846, so that issue will be closed when this PR is merged.