1.0.6 • Published 9 years ago

esbootstrap v1.0.6

Weekly downloads
6
License
MIT
Repository
github
Last release
9 years ago

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: {...}, // @see http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-create
    mappingRequestBody: {...}, // @see http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-indices-putmapping
    fixtures: fixtures // @see http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-bulk 
};

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 // @see http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-bulk 
};

esbootstrap.loadFixtures(options, function() {
    //....
});

Tests

b****-please

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago