diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/CreateIndexRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/indices/CreateIndexRequest.java index 512f0e77f9..3d413e1367 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/CreateIndexRequest.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/indices/CreateIndexRequest.java @@ -33,6 +33,7 @@ package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.io.StringReader; import java.util.HashMap; import java.util.Map; import java.util.function.Function; @@ -43,6 +44,7 @@ import org.opensearch.client.json.JsonpSerializable; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.jackson.JacksonJsonpMapper; import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.RequestBase; import org.opensearch.client.opensearch._types.Time; @@ -304,6 +306,25 @@ public final Builder mappings(@Nullable TypeMapping value) { return this; } + /** + * Mapping for fields in the index. If specified, this mapping can include: + *
+ * API name: {@code mappings}
+ */
+ public final Builder mappings(@Nullable String typeMappingJson) {
+ return this.mappings(deserialize(TypeMapping._DESERIALIZER, typeMappingJson));
+ }
+
+ private
@@ -366,6 +387,13 @@ public final Builder settings(@Nullable IndexSettings value) {
return this;
}
+ /**
+ * API name: {@code settings}
+ */
+ public final Builder settings(String indexSettingsJson) {
+ return this.settings(deserialize(IndexSettings._DESERIALIZER, indexSettingsJson));
+ }
+
/**
* API name: {@code settings}
*/