-
Notifications
You must be signed in to change notification settings - Fork 138
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
Fixing bug where mapping accepts both dimension and model-id #2410
Conversation
There's a separate unit test(unrelated to this) that had both parameters (dimension and model-id) specified. I rolled back my change locally and figured out what the expected failure case in this unit test was. Seems as though it's trying to reach the validation here which was why the model-id was provided. Assuming this was supposed to test the omission of compression and mode when a model is present I'm not sure why dimension was also set here. Removing the dimension field succeeded the test. I've reran the debugger to make sure the code coverage would still yield the same result. If my mental model here isn't accurate please let me know and I can make the appropriate changes. |
&& builder.modelId.get() != null | ||
&& parserContext.indexVersionCreated().onOrAfter(Version.V_2_19_0)) { | ||
throw new IllegalArgumentException( | ||
String.format(Locale.ROOT, "Dimension and model can not be both specified in the mapping: %s", name) |
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.
nit: "Cannot specify both a modelId and dimension in the mapping"
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.
Addressed
Signed-off-by: Mark Wu <[email protected]>
Signed-off-by: Mark Wu <[email protected]>
Signed-off-by: Mark Wu <[email protected]>
Signed-off-by: Mark Wu <[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.
LGTM. Thanks for making the changes and addressing feedback comments.
Signed-off-by: Mark Wu <[email protected]> (cherry picked from commit d142366)
Description
Current Problem
model_id
anddimension
parameters simultaneouslymodel_id
)dimension
parameter)Implemented Solution
model_id
anddimension
parameters are present in the index creation requestVersion Scope
Testing
Normal input:
On 3.0:
Related Issues
Resolves #2318
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.