rubber-es

0.0.1 • Public • Published

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

/rubber-es/

    Package Sidebar

    Install

    npm i rubber-es

    Weekly Downloads

    1

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • dubfriend