Skip to content

DubFriend/rubber-es

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 }
    }
]);

About

Wrapper for elasticsearch client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published