Skip to content

Commit 8db704c

Browse files
committed
javadocs to make this a bit clearer
1 parent 4cbddac commit 8db704c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

server/src/main/java/org/elasticsearch/cluster/metadata/MappingMetadata.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)