diff --git a/plugin/src/main/java/org/opensearch/ml/indices/MLIndicesHandler.java b/plugin/src/main/java/org/opensearch/ml/indices/MLIndicesHandler.java index 43da6b93d8..f44c0fd1a9 100644 --- a/plugin/src/main/java/org/opensearch/ml/indices/MLIndicesHandler.java +++ b/plugin/src/main/java/org/opensearch/ml/indices/MLIndicesHandler.java @@ -100,7 +100,7 @@ public void initMLIndexIfAbsent(String indexName, String mapping, ActionListener log.error("Failed to create index " + indexName, e); listener.onFailure(e); }); - CreateIndexRequest request = new CreateIndexRequest(indexName); + CreateIndexRequest request = new CreateIndexRequest(indexName).mapping(mapping); client.admin().indices().create(request, ActionListener.runBefore(actionListener, () -> threadContext.restore())); } catch (Exception e) { log.error("Failed to init index " + indexName, e);