esbootstrap
esboostrap will bootstrap, map and load fixtures for an elasticsearch index.
Installation
Add esboostrap in devDependencies
npm install esbootstrap --save-dev
Usage
var esbootstrap = require('esbootstrap');
var fixtures = require('./path/tofixtures.json');
var options = {
elasticsearch: {
host: ...
log: ...
requestTimeout: ...
keepAlive: ..
},
indexName:...,
createRequestBody: {...},
mappingRequestBody: {...},
fixtures: fixtures
};
esbootstrap.bootstrap(options, function() {
});
Or if you already have an elasticsearch instance up
and running and want to only load some data:
var fixtures = require('./path/tofixtures.json');
var options = {
elasticsearch: {
host: ...
log: ...
requestTimeout: ...
keepAlive: ..
},
fixtures: fixtures
};
esbootstrap.loadFixtures(options, function() {
});
Tests