The single update() operation is not affected because its code is different.
The bug is at /lib/service/storage/elasticsearch.ts#L3120, _processExtract():
_source: Object.assign({}, metadata, document.body),
The metadata content is correct, but assign() states that "Later sources' properties overwrite earlier ones.",
and document.body has already these properties, with null values.
I got the expected behaviour with this hack in the distributed js:
_source: Object.assign({}, document.body, metadata),
I didn't investigate on the two other assign() usages in this file, but they probably have a similar defect.
Context (Environment)
Kuzzle version: master
Node.js version:
SDK version: