Skip to content

Commit fc5bf9a

Browse files
Add mapping method back referenced in other repos (#2636) (#2649)
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>
1 parent be15fbc commit fc5bf9a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequest.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,22 @@ public CreateIndexRequest mapping(String mapping) {
245245
return this;
246246
}
247247

248+
/**
249+
* Adds mapping that will be added when the index gets created.
250+
*
251+
* @param source The mapping source
252+
* @param xContentType The content type of the source
253+
*/
254+
public CreateIndexRequest mapping(String source, XContentType xContentType) {
255+
return mapping(new BytesArray(source), xContentType);
256+
}
257+
248258
/**
249259
* Adds mapping that will be added when the index gets created.
250260
*
251261
* @param source The mapping source
252262
* @param xContentType the content type of the mapping source
253-
* @deprecated types are being removed
254263
*/
255-
@Deprecated
256264
private CreateIndexRequest mapping(BytesReference source, XContentType xContentType) {
257265
Objects.requireNonNull(xContentType);
258266
Map<String, Object> mappingAsMap = XContentHelper.convertToMap(source, false, xContentType).v2();

0 commit comments

Comments
 (0)