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]>
Signed-off-by: Nicholas Walter Knize <[email protected]>

(cherry picked from commit bcaa06b)
  • Loading branch information
dreamer-89 authored and nknize committed Mar 29, 2022
1 parent 39dda1d commit 874058f
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 874058f

Please sign in to comment.