Get elastic alias and see the pointed index
var Elastic = require('machines-elastic');
// Get elastic alias and see the pointed index
Elastic.getAlias({
hostname: 'localhost',
name: 'alias',
port: 9200,
}).exec({
// An unexpected error occurred.
error: function (err) {
},
// Could not connect to ElasticSearch at the provided hostname and port.
couldNotConnect: function () {
},
// The given alias does not exists.
aliasNotExists: function () {
},
// OK.
success: function (result) {
},
});
The hostname of your ElasticSearch server
'localhost'
The alias name
'alias'
The port your ElasticSearch server is running on
9200
An unexpected error occurred.
Could not connect to ElasticSearch at the provided hostname and port.
The given alias does not exists.
OK.
'index_1'