-
Notifications
You must be signed in to change notification settings - Fork 20
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
elasticsearch6 driver bulkCommit implementation #58
Conversation
lib/databases/elasticsearch6.js
Outdated
@@ -150,10 +154,14 @@ _.extend(Elasticsearch.prototype, { | |||
}, | |||
function(err, res) { | |||
if (err) { | |||
return callback(err); | |||
console.log('---') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably not needed, right? ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
damn :)
hmm, for some reason mocha hangs after finish, any ideas? |
lib/databases/elasticsearch6.js
Outdated
obj = vm.attributes; | ||
bulkOperation.push( | ||
{ index: { _index: self.indexAndTypeName, _type: self.indexAndTypeName, _id: vm.id, op_type: 'create' } }, | ||
obj, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a missin } ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really, but there is a trailing comma which is a problem on older node
nailed it ;) |
nice job! |
A basic bulkCommit implementation.
Additional things that can be done:
*. By huge amount of updates / vms ( ex: 500+, configurable of course) at once, the bulk operation can be split into smaller ones.
*. Introduction of BulkCommitError which is a container of multiple errors and can be feed it with individual errors for each vm ( will need some a little rework from the other implementations ).