Skip to content

Instantly share code, notes, and snippets.

@spalger
Created March 14, 2014 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spalger/9550110 to your computer and use it in GitHub Desktop.
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.
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