Skip to content

Commit

Permalink
Add mapping method back referenced in other repos (#2636) (#2648)
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)

Co-authored-by: Suraj Singh <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and dreamer-89 authored Mar 29, 2022
1 parent f38ef61 commit 7d8f9ac
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 7d8f9ac

Please sign in to comment.