Skip to content

Commit

Permalink
Add mapping method back referenced in other repos (#2636)
Browse files Browse the repository at this point in the history
Signed-off-by: Suraj Singh <[email protected]>
  • Loading branch information
dreamer-89 authored Mar 29, 2022
1 parent d8a1ba6 commit bcaa06b
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,22 @@ public CreateIndexRequest mapping(String mapping) {
return this;
}

/**
* Adds mapping that will be added when the index gets created.
*
* @param source The mapping source
* @param xContentType The content type of the source
*/
public CreateIndexRequest mapping(String source, XContentType xContentType) {
return mapping(new BytesArray(source), xContentType);
}

/**
* Adds mapping that will be added when the index gets created.
*
* @param source The mapping source
* @param xContentType the content type of the mapping source
* @deprecated types are being removed
*/
@Deprecated
private CreateIndexRequest mapping(BytesReference source, XContentType xContentType) {
Objects.requireNonNull(xContentType);
Map<String, Object> mappingAsMap = XContentHelper.convertToMap(source, false, xContentType).v2();
Expand Down

0 comments on commit bcaa06b

Please sign in to comment.