Skip to content

Commit

Permalink
Wrap CreateIndexRequest mappings in _doc key as required (#809)
Browse files Browse the repository at this point in the history
* Wrap CreateIndexRequest mappings in _doc key as required

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add changelog/release notes

Signed-off-by: Daniel Widdis <widdis@gmail.com>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
(cherry picked from commit 834903f)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Jul 26, 2024
1 parent a6cd332 commit 4f9b0e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4f9b0e3

Please sign in to comment.