-
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] Default Mapping #2151
[Remove] Default Mapping #2151
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,6 @@ | |
import org.opensearch.common.xcontent.XContentBuilder; | ||
import org.opensearch.common.xcontent.XContentParser; | ||
import org.opensearch.common.xcontent.XContentParser.Token; | ||
import org.opensearch.index.mapper.MapperService; | ||
|
||
import java.io.IOException; | ||
import java.util.ArrayList; | ||
|
@@ -301,10 +300,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws | |
} else { | ||
MappingMetadata mappings = null; | ||
for (final ObjectObjectCursor<String, MappingMetadata> typeEntry : indexMappings) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably future change, but I believe we would significantly reduce the amount of "heap garbage" when replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think that would be a good followup PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
if (typeEntry.key.equals(MapperService.DEFAULT_MAPPING) == false) { | ||
assert mappings == null; | ||
mappings = typeEntry.value; | ||
} | ||
assert mappings == null; | ||
mappings = typeEntry.value; | ||
} | ||
if (mappings == null) { | ||
// no mappings yet | ||
|
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.
@nknize I am a bit confused by this change: the only mapping which should left at this point is
_doc
, would we still let anyone to change the (single) mapping type for index (as here fe,_doc
->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.
(I think I found the answer to my question)
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.
type support hasn't been completely removed yet so this will get cleaned up in a follow up.
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.
👍