Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Use rawLow/rawHigh instead of parsedLow/parsedHigh in function - hasDecimalPart() #17247

Open
Shailesh-Kumar-Singh opened this issue Feb 4, 2025 · 1 comment
Assignees
Labels
bug Something isn't working Search Search query, autocomplete ...etc

Comments

@Shailesh-Kumar-Singh
Copy link
Contributor

Describe the bug

In the NumericNonDecimalMapper class, the getRangeMatchFilter method is responsible for handling range-based filtering by converting rawLow and rawHigh into Long values using numberType().parse().toLong().

However, the method currently checks for the presence of a decimal part at this location for rawLow and at this location for rawHigh using hasDecimalPart(parsedLow) and hasDecimalPart(parsedHigh). Since parsedLow and parsedHigh have already been converted to Long, any decimal information from rawLow and rawHigh is lost, making the check ineffective and leading to incorrect range adjustments.

To ensure correct validation, hasDecimalPart() should instead be called with the original rawLow and rawHigh values.

Related component

Search

To Reproduce

Use decimals as values for non-decimal numeric fields (byte/short/int/long) in query

Expected behavior

hasDecimalPart() should instead be called with the original rawLow and rawHigh values.

Additional Details

No response

@Shailesh-Kumar-Singh Shailesh-Kumar-Singh added bug Something isn't working untriaged labels Feb 4, 2025
@github-actions github-actions bot added the Search Search query, autocomplete ...etc label Feb 4, 2025
@expani
Copy link
Contributor

expani commented Feb 5, 2025

Thanks @Shailesh-Kumar-Singh for filing the issue. Looks like I missed this edge case even in the UTs
Will raise a fix soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Search Search query, autocomplete ...etc
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants