From e5a93a1e29d3d9a9f6cc360029b89aad611227f9 Mon Sep 17 00:00:00 2001 From: Yaliang Wu Date: Mon, 18 Apr 2022 16:29:02 -0700 Subject: [PATCH] create model/task index with correct mapping (#284) Signed-off-by: Yaliang Wu (cherry picked from commit 0bae1348c80463ea40f193d0db8f8ccfd2467dd0) --- .../main/java/org/opensearch/ml/indices/MLIndicesHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);