From 734a433d2f0309227a529823ac7731a4b8b3372c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 10 Aug 2021 19:13:49 +0200 Subject: [PATCH] :zap: Fix mapping param on regular node --- .../nodes-base/nodes/Elasticsearch/Elasticsearch.node.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nodes-base/nodes/Elasticsearch/Elasticsearch.node.ts b/packages/nodes-base/nodes/Elasticsearch/Elasticsearch.node.ts index 967b90a842..45ec2ae8ff 100644 --- a/packages/nodes-base/nodes/Elasticsearch/Elasticsearch.node.ts +++ b/packages/nodes-base/nodes/Elasticsearch/Elasticsearch.node.ts @@ -286,15 +286,15 @@ export class Elasticsearch implements INodeType { const body = {} as IDataObject; const qs = {} as IDataObject; - const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject & { mappings: string }; if (Object.keys(additionalFields).length) { const { aliases, mappings, settings, ...rest } = additionalFields; - Object.assign(body, aliases, mappings, settings); + Object.assign(body, aliases, JSON.parse(mappings), settings); Object.assign(qs, rest); } - responseData = await elasticsearchApiRequest.call(this, 'PUT', `/${indexId}`); + responseData = await elasticsearchApiRequest.call(this, 'PUT', `/${indexId}`, body, qs); responseData = { id: indexId, ...responseData }; delete responseData.index;