Skip to content

Commit 349db41

Browse files
[Backport 2.16] Wrap CreateIndexRequest mappings in _doc key as required (#815)
Wrap CreateIndexRequest mappings in _doc key as required (#809) * Wrap CreateIndexRequest mappings in _doc key as required * Add changelog/release notes --------- (cherry picked from commit 834903f) Signed-off-by: Daniel Widdis <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 55a7c50 commit 349db41

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
2222

2323
### Bug Fixes
2424
- Handle Not Found exceptions as successful deletions for agents and models ([#805](https://github.com/opensearch-project/flow-framework/pull/805))
25+
- Wrap CreateIndexRequest mappings in _doc key as required ([#809](https://github.com/opensearch-project/flow-framework/pull/809))
2526

2627
### Infrastructure
2728
### Documentation

release-notes/opensearch-flow-framework.release-notes-2.16.0.0.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Compatible with OpenSearch 2.16.0
1010

1111
### Bug Fixes
1212
- Handle Not Found deprovision exceptions as successful deletions ([#805](https://github.com/opensearch-project/flow-framework/pull/805))
13+
- Wrap CreateIndexRequest mappings in _doc key as required ([#809](https://github.com/opensearch-project/flow-framework/pull/809))

src/main/java/org/opensearch/flowframework/indices/FlowFrameworkIndicesHandler.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ public void initFlowFrameworkIndexIfAbsent(FlowFrameworkIndex index, ActionListe
193193
logger.error(errorMessage, e);
194194
internalListener.onFailure(new FlowFrameworkException(errorMessage, ExceptionsHelper.status(e)));
195195
});
196-
CreateIndexRequest request = new CreateIndexRequest(indexName).mapping(mapping).settings(indexSettings);
196+
CreateIndexRequest request = new CreateIndexRequest(indexName).mapping("{\"_doc\":" + mapping + "}")
197+
.settings(indexSettings);
197198
client.admin().indices().create(request, actionListener);
198199
} else {
199200
logger.debug("index: {} is already created", indexName);

0 commit comments

Comments
 (0)