Preformatted textHi, I'm developing custom kibana plugin, and try to retrieve document using the Elasticsearch JS method "GET", but get nothing. I have some questions about how to fetch content from the "response", and my code is like this.
server.route({
path : '/api/log-analysis/data',
method: ['POST', 'GET'],
handler: function(request, reply){
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data');
callWithRequest(request, 'get', {
index: '[my index]',
type: '[my type]',
id: '[my id]'
}).then(function(response){
reply(response.data);
});
}
});
Can anyone give me some advice? Thanks!