Skip to content

Commit

Permalink
Add mapping method back referenced in other repos (#2636) (#2649)
Browse files Browse the repository at this point in the history
Signed-off-by: Suraj Singh <surajrider@gmail.com>
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

(cherry picked from commit bcaa06b)

Co-authored-by: Suraj Singh <79435743+dreamer-89@users.noreply.github.com>
  • Loading branch information
opensearch-trigger-bot[bot] and dreamer-89 committed Mar 29, 2022
1 parent be15fbc commit fc5bf9a
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 fc5bf9a

Please sign in to comment.