你可以告诉我如何在expressjs
解决这个错误信息POST /test/_search 404 45.691 ms - 1235
Trace: Not Found
我刚刚在带弹性搜索的快递中尝试了这段代码
/* GET home page. */
router.get('/', function(req, res, next) {
client.search({
index: 'test',
body:{
query:{
multi_match:{
query: 'i5',
fields: ['title']
}
}
}
}).then(function (response) {
var hits = response.hits.hits;
console.log(response);
console.log(response.hits);
console.log(response.hits.hits);
}, function (error) {
console.trace(error.message);
})
res.render('index', { title: 'Express'});
});
请帮助解决此问题谢谢