-
Notifications
You must be signed in to change notification settings - Fork 125
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
Switch type of expandNested from boolean to Boolean #2333
Conversation
Signed-off-by: Heemin Kim <[email protected]>
Rolling upgrade is failing because the query data type is changed. However, it will pass once this change is back ported to 2.x branch. |
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.
is there a test that is checking scenario similar to one in neural search (expandNested
is not set)?
Yes. All the existing tests have query without expandNested being set. |
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 to me, thank you!
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.
Please add IT and UT for the null value too to ensure everything is working correctly
public Optional<Boolean> getExpandNested() { | ||
return Optional.ofNullable(expandNested); | ||
} |
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.
should we add the default value directly here rather than in src/main/java/org/opensearch/knn/index/query/KNNQueryFactory.java
?
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.
I will let the factory to decide on default value to be consist with other values. For example, rescoreContext's default value is null but we are still wrapping it as Optional instead of just returning null.
All existing nested queries are actually using null value here. So they are already covered. |
Signed-off-by: Heemin Kim <[email protected]> (cherry picked from commit aa6936a)
Signed-off-by: Heemin Kim <[email protected]> (cherry picked from commit aa6936a) Co-authored-by: Heemin Kim <[email protected]>
Description
Change the type of the
expandNested
variable fromboolean
toBoolean
. This modification allows the neural search to pass theexpandNestedDocs
parameter as-is (null
,true
, orfalse
), instead of convertingnull
orfalse
tofalse
andtrue
totrue
.https://github.com/opensearch-project/neural-search/blob/main/src/main/java/org/opensearch/neuralsearch/query/NeuralQueryBuilder.java#L315
Related Issues
N/A
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.