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

LUCENE-10232: Fix MultiRangeQuery to confirm all dimensions for a given range match #437

Merged
merged 2 commits into from Nov 30, 2021

Conversation

gsmiller
Copy link
Contributor

Description

MultiRangeQuery was incorrectly considering a range to match if at least one dimension matched (instead of requiring all dimensions to match).

Solution

Corrected the logic in MultiRangeQuery. Also updated comparisons to use ArrayUtil.ByteArrayComparator.

Tests

Updated existing tests to expose the bug and confirmed the fix addresses it.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Lucene maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.

@iverase
Copy link
Contributor

iverase commented Nov 30, 2021

+1 to this fix, it doesn't make sense as it is.

@uschindler
Copy link
Contributor

I also like it that it uses the new comparator interface in ArrayUtil.

@gsmiller gsmiller merged commit f48a430 into apache:main Nov 30, 2021
@gsmiller
Copy link
Contributor Author

Thanks @iverase , @uschindler , @jpountz !

@gsmiller gsmiller deleted the LUCENE-10232-fix-multi-range-query branch November 30, 2021 20:02
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.

None yet

4 participants