rubber-es
v0.0.1
Published
Wrapper for elasticsearch client
Downloads
5
Maintainers
Readme
Rubber ES
A lightweight wrapper for the elasticsearch client
npm install rubber-es --save
var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client({ host: '127.0.0.1:9200' });
var rubber = require('./rubber-es.js')(client);
index
index exposes the same api as the elasticsearch.index method. One may additionally supply an array of objects to perform a bulk insert.
rubber.index({
index: that.index,
type: that.type,
id: '1',
body: { foo: 'bar' }
});
rubber.index([
{
index: that.index,
type: that.type,
id: '1',
body: { a: 1 }
},
{
index: that.index,
type: that.type,
id: '2',
body: { b: 2 }
}
]);