-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elasticsearch - pushResults and pushErrors doesn't push the data to downstream #45
Comments
Thanks @girishgoudapatil. What elasticsearch client version / server version are you using? Are you using Here is the corresponding test: it('pipes data into elasticsearch',function() {
var i = 0;
var upsert = etl.elastic.index(client,'test','test',{pushResult:true});
return data.stream()
.pipe(etl.map(function(d) {
d._id = i++;
return d;
}))
.pipe(etl.collect(100))
.pipe(upsert)
.promise()
.then(function(d) {
assert.equal(d[0].items.length,3);
assert.deepEqual(d[0].items[0].body,data.data[0]);
});
}); https://circleci.com/gh/ZJONSSON/node-etl/138
|
@ZJONSSON thanks for the quick response. I am using elasticsearch@11.0.1 module , below code returns empty dataset for me in the resolve. .pipe(etl.collect(500))
.pipe(etl.elastic.index(esClient,index,'test', {
concurrency : 5,
pushResult : true,
pushErrors : true
}))
.promise()
.then(function (data) {
console.log(data);
return upload(tmpFilename, s3key);
}) actually pushing everything in one go under resolve would be memory intensive if you are processing millions of records |
Ah I spotted the culprit. Your code should work if you simply remove |
See #46 - please reopen if the issue persists |
In elasticsearch bulk operation pushResults and pushErrors have not effect as the data is not being pushed to the stream .
options is stated as pushResults but internally code is checking for pushResult
if (!self.options.pushResult && !self.options.pushErrors) return;
results data is not being pushed to the stream , so cannot be caught in the downstream
this doesn't work.
@ZJONSSON could you please take a look ?
The text was updated successfully, but these errors were encountered: