看这个例子
client.execute{search in "places"->"cities" query "paris" start 5 limit 10}
是否可以选择挂钩登录到client.execute以记录客户端所做的所有操作(索引,搜索等)?
我看到了这个answer,但我不想做类似的事情:
val req = search in "index" / "type" query "kate bush"
logger.debug(s"Search request ${req.show}")
我希望客户端根据日志记录级别记录所有内容
答案 0 :(得分:0)
您可以使用覆盖执行功能
来定义自己的ElasticClientapp.post('/upload', function (req, res) {
//var dirname = require('path').dirname(__dirname);
//var dirname1 = require('path').dirname(dirname);
var filename = req.files[0].filename;
var path = req.files[0].path;
var type = req.files[0].mimetype;
var options = {
contentType: type,
metadata: { fileName: filename }
}
blobSvc.createBlockBlobFromLocalFile(containerName, filename, path, options, function (error, result, response) {
if (error != null) {
console.log('Azure Full Error: ', error)
} else {
console.log(result);
console.log(response);
var user = new User();
user.name = req.body.name;
user.picture = 'https://yourblob.blob.core.windows.net/profile/' + result.name;
user.save(function (err) {
if (err) {
return res.json(err.message);
}
else {
return res.json({ User: user });
}
});
}
});
});