Skip to content
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

Merged
merged 8 commits into from
Apr 11, 2018
Merged

elasticsearch6 driver bulkCommit implementation #58

merged 8 commits into from
Apr 11, 2018

Conversation

nanov
Copy link
Contributor

@nanov nanov commented Apr 11, 2018

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 ).

@@ -150,10 +154,14 @@ _.extend(Elasticsearch.prototype, {
},
function(err, res) {
if (err) {
return callback(err);
console.log('---')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not needed, right? ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

damn :)

@nanov
Copy link
Contributor Author

nanov commented Apr 11, 2018

hmm, for some reason mocha hangs after finish, any ideas?

obj = vm.attributes;
bulkOperation.push(
{ index: { _index: self.indexAndTypeName, _type: self.indexAndTypeName, _id: vm.id, op_type: 'create' } },
obj,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a missin } ?

Copy link
Contributor Author

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

@nanov
Copy link
Contributor Author

nanov commented Apr 11, 2018

nailed it ;)

@adrai
Copy link
Contributor

adrai commented Apr 11, 2018

nice job!

@adrai adrai merged commit 61c4347 into thenativeweb:master Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants