ElasticSearch.searchcustom()

Search custom on Elastic Search

Usage

Hover over inputs/exits for more info.

var ElasticSearch = require('machines-elasticsearch');


// Search custom on Elastic Search

ElasticSearch.searchcustom({

hostname: 'localhost',

index: 'myindex',

type: 'mytype',

query: 'cute dogs',

port: 9200,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

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

couldNotConnect: function () {

 

},

// The specified index does not exist.

noSuchIndex: function () {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

hostname required

The hostname of your ElasticSearch server

'localhost'
index required

The name of the index to search

'myindex'
type required

The name of the type to search

'mytype'
query required

The search query

'cute dogs'
port

The port your ElasticSearch server is running on

9200

Exits

error

An unexpected error occurred.

couldNotConnect

Could not connect to ElasticSearch at the provided hostname and port

noSuchIndex

The specified index does not exist.

success

OK.

[]