diff --git a/CHANGELOG.md b/CHANGELOG.md index 37f8cb28d..57d37eaa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) ### Bug Fixes - Handle Not Found exceptions as successful deletions for agents and models ([#805](https://github.com/opensearch-project/flow-framework/pull/805)) +- Wrap CreateIndexRequest mappings in _doc key as required ([#809](https://github.com/opensearch-project/flow-framework/pull/809)) ### Infrastructure ### Documentation diff --git a/release-notes/opensearch-flow-framework.release-notes-2.16.0.0.md b/release-notes/opensearch-flow-framework.release-notes-2.16.0.0.md index a4cd2157c..388dba240 100644 --- a/release-notes/opensearch-flow-framework.release-notes-2.16.0.0.md +++ b/release-notes/opensearch-flow-framework.release-notes-2.16.0.0.md @@ -10,3 +10,4 @@ Compatible with OpenSearch 2.16.0 ### Bug Fixes - Handle Not Found deprovision exceptions as successful deletions ([#805](https://github.com/opensearch-project/flow-framework/pull/805)) +- Wrap CreateIndexRequest mappings in _doc key as required ([#809](https://github.com/opensearch-project/flow-framework/pull/809)) diff --git a/src/main/java/org/opensearch/flowframework/indices/FlowFrameworkIndicesHandler.java b/src/main/java/org/opensearch/flowframework/indices/FlowFrameworkIndicesHandler.java index 18f0a9780..43c00d230 100644 --- a/src/main/java/org/opensearch/flowframework/indices/FlowFrameworkIndicesHandler.java +++ b/src/main/java/org/opensearch/flowframework/indices/FlowFrameworkIndicesHandler.java @@ -193,7 +193,8 @@ public void initFlowFrameworkIndexIfAbsent(FlowFrameworkIndex index, ActionListe logger.error(errorMessage, e); internalListener.onFailure(new FlowFrameworkException(errorMessage, ExceptionsHelper.status(e))); }); - CreateIndexRequest request = new CreateIndexRequest(indexName).mapping(mapping).settings(indexSettings); + CreateIndexRequest request = new CreateIndexRequest(indexName).mapping("{\"_doc\":" + mapping + "}") + .settings(indexSettings); client.admin().indices().create(request, actionListener); } else { logger.debug("index: {} is already created", indexName);