Skip to content

Commit

Permalink
Wrap CreateIndexRequest mappings in _doc key as required
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Widdis <[email protected]>
  • Loading branch information
dbwiddis committed Jul 26, 2024
1 parent 034dff7 commit f78926a
Showing 1 changed file with 2 additions and 1 deletion.
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 f78926a

Please sign in to comment.