From bcaa06bc0ffe8d350e80b0da53af5bf2ba9f99d0 Mon Sep 17 00:00:00 2001 From: Suraj Singh <79435743+dreamer-89@users.noreply.github.com> Date: Tue, 29 Mar 2022 09:27:28 -0700 Subject: [PATCH] Add mapping method back referenced in other repos (#2636) Signed-off-by: Suraj Singh --- .../admin/indices/create/CreateIndexRequest.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequest.java index 7f1f516d13a..26ff4f1da3b 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequest.java @@ -249,10 +249,18 @@ public class CreateIndexRequest extends AcknowledgedRequest * 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 + * @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 private CreateIndexRequest mapping(BytesReference source, XContentType xContentType) { Objects.requireNonNull(xContentType); Map mappingAsMap = XContentHelper.convertToMap(source, false, xContentType).v2();