与ElasticSearch通信API
官方文档推荐
服务器客户端
const adminCluster = server.plugins.elasticsearch.getCluster('admin');
const dataCluster = server.plugins.elasticsearch.getCluster('data');
//ping as the configured elasticsearch.user in kibana.yml
adminCluster.callWithInternalUser('ping');
//ping as the user specified in the current requests header
adminCluster.callWithRequest(req, 'ping');浏览器客户端
uiModules.get('kibana')
.run(function (es) {
es.ping()
.catch(err => {
console.log('error pinging servers');
});
});非官方文档推荐
Why
服务器客户端
Last updated