File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
server/src/main/java/org/elasticsearch/cluster/metadata Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,12 @@ public MappingMetadata(DocumentMapper docMapper) {
5454 this .routingRequired = docMapper .routingFieldMapper ().required ();
5555 }
5656
57+ /**
58+ * Create MappingMetadata from compressed XContent
59+ *
60+ * The xcontent should have a containing map whose key is a type - typically '_doc'. This
61+ * will be discarded when the mapping is returned via {@link #sourceAsMap()}
62+ */
5763 public MappingMetadata (CompressedXContent mapping ) {
5864 this .source = mapping ;
5965 // TODO do this via pull parsing - we don't need to reify the whole map!
@@ -67,6 +73,11 @@ public MappingMetadata(CompressedXContent mapping) {
6773 }
6874 }
6975
76+ /**
77+ * Create MappingMetadata from a java map
78+ * @param type the type, typically _doc
79+ * @param mapping the mappings, which may or not be wrapped with the type
80+ */
7081 public MappingMetadata (String type , Map <String , Object > mapping ) {
7182 this .type = type ;
7283 try {
You can’t perform that action at this time.
0 commit comments