-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Honor topvalue while determining isMissingvalueCompetitive in case bottom is not set #12520
Conversation
This was observed here -> opensearch-project/OpenSearch#9537 |
…ttom is not set Signed-off-by: gashutos <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this bug, the change looks correct to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, can you add a test for missing bottom minimum value (for desc sort) as well?
Thanks @backslasht .
The test missing was, missing value comparison with top value when bottom is not set and top value is coming as missing value which I added. |
Sorry, I jumbled the terminologies, I meant a test with missing minimum value for desc sort. |
…fter as missing value Signed-off-by: gashutos <[email protected]>
Got it, makes sense. Added the test. I kept missing value as Long.MAX_VALUE only for this, it doesnt really matter for our logic for checking its competitiveness. |
Signed-off-by: gashutos <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gashutos for making the changes.
I'll merge next week if nobody beats me to it. |
Thanks @gashutos ! |
Description
There is a bug introduced with #12334 when field contains missing value and if those missing values are competitive.
isMissingValueCompetitive()
implementation gets invoked comparingmissingValue
withbottom
when bottom is not even set whenAfter
is set.We should check with topValue in cases when
bottom
is not set. This PR adds that check.Added tests for this scenario as well.
Lucene issue
#12521