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

Fix sorting of single valued numeric fields #811

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

aprudhomme
Copy link
Contributor

To make doc value range queries work correctly with single valued FLOAT and DOUBLE fields, the encoding was changed to be sortable. This causes a problem, since the standard SortField will assume they are encoded as raw bits. This change uses SortedNumericSortField for single and multi valued fields.

This issue was missed because the current sort field tests did not include negative numbers. The tests have been modified to correct this. Additionally, tests have been added for multi valued numeric fields.

This does seem to cause an issue when trying to use a singled valued numeric field for index sorting, but I think we can fix this later and add better test coverage around this feature.

I'm starting to wonder if there is really a benefit to supporting single valued fields at all.

@aprudhomme aprudhomme requested a review from sarthakn7 January 8, 2025 18:25
@aprudhomme aprudhomme merged commit 2108ef0 into Yelp:main Jan 9, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants