Elastic.bulk()

Perform many index/delete operations in a single API call.

http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-bulk

Usage

Hover over inputs/exits for more info.

var Elastic = require('machines-elastic');


// Perform many index/delete operations in a single API call.

Elastic.bulk({

hostname: 'localhost',

actions: [],

port: 9200,

index: 'myindex',

type: 'myindex',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Could not connect to ElasticSearch at the provided hostname and port.

couldNotConnect: function () {

 

},

// OK.

success: function () {

 

},

});

Inputs

hostname required

The hostname of your ElasticSearch server

'localhost'
actions required

Actions to do ! (see elastic documentation for more details)

port

The port your ElasticSearch server is running on

9200
index

Default index for items which don't provide one

'myindex'
type

Default document type for items which don't provide one

'myindex'

Exits

error

An unexpected error occurred.

couldNotConnect

Could not connect to ElasticSearch at the provided hostname and port.

success

OK.