Created
March 14, 2014 15:33
-
-
Save spalger/9550110 to your computer and use it in GitHub Desktop.
Modified reproduction for elastic/elasticsearch-js#54, modified to comply with jshint and reports progress and success.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var elasticsearch = require('./src/elasticsearch'); | |
var async = require('async'); | |
var _ = require('lodash-node'); | |
var client = new elasticsearch.Client({ | |
host: 'localhost:9200' | |
}); | |
async.eachSeries(_.range(100), function (value, done) { | |
async.eachSeries(_.range(500), function (value, done) { | |
client.create({ index: 'tests', type: 'test', body: {something: true, value: value} }, done); | |
}, function (err) { | |
process.stdout.write('.'); | |
done(err); | |
}); | |
}, function () { | |
console.log('\nsuccess'); | |
client.close(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment