-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Remove] Multiple Types from IndexTemplateMetadata #2400
[Remove] Multiple Types from IndexTemplateMetadata #2400
Conversation
Can one of the admins verify this patch? |
❌ Gradle Check failure 1a261f7534000cc101e77471943f025c24d9563b |
1a261f7
to
1342608
Compare
❌ Gradle Check failure 1342608c99734d28087cff11f503394b7d6507b0 |
1342608
to
b5cc5c2
Compare
serverTemplateBuilder.putMapping(MapperService.SINGLE_MAPPING_NAME, clientITMD.mappings().source()); | ||
// The client-side mappings never include a wrapping type, but server-side mappings | ||
// for index templates still do so we need to wrap things here | ||
String mappings = "{\"" + MapperService.SINGLE_MAPPING_NAME + "\": " + clientITMD.mappings().source().string() + "}"; |
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.
👍 but will be fixed later?
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.
Yes
❌ Gradle Check failure b5cc5c206e47d1098d628659f93ff1f33fbefcce |
b5cc5c2
to
b89417a
Compare
❌ Gradle Check failure b89417a20a27f729f8d5bd01633c224478a50958 |
|
start gradle check |
@dreamer-89 The pull request was merged moments ago, may need rebase |
@nknize : Can you please rebase against main ? |
✅ Gradle Check success b89417a20a27f729f8d5bd01633c224478a50958 |
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!
Thank you for taking time to raise this PR.
source = Collections.singletonMap(MapperService.SINGLE_MAPPING_NAME, source); | ||
} else if (MapperService.SINGLE_MAPPING_NAME.equals(type) == false) { | ||
// if it has a different type name, then unwrap and rewrap with _doc | ||
source = Collections.singletonMap(MapperService.SINGLE_MAPPING_NAME, source.get(type)); |
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.
What is the benefit of re-wrapping with _doc instead of throwing IllegalArgumentException ? Is this for handling typed indices from older versions ?
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.
For template bwc; same as above.
Removes multi-type support from IndexTemplateMetadata so that instead of holding a map of multiple types to mappings, it only returns a single mapping for a single type. Signed-off-by: Nicholas Walter Knize <[email protected]>
Signed-off-by: Nicholas Walter Knize <[email protected]>
Signed-off-by: Nicholas Walter Knize <[email protected]>
Signed-off-by: Nicholas Walter Knize <[email protected]>
b89417a
to
16aff4e
Compare
This issue is getting tracked in #2359
|
start gradle check |
…x indices Signed-off-by: Nicholas Walter Knize <[email protected]>
See #2359 (comment) |
Another #1746; refiring
|
start gradle check |
Another #1561 failure; refiring
|
start gradle check |
Removes multi-type support from IndexTemplateMetadata so that instead of holding
a map of multiple types to mappings, it only returns a single mapping for a
single type. Also removes type from documentMapper() method to avoid any
accidental NullPointerExceptions in the internal mapping retrieval.
relates #1940
closes #2359