我正在尝试在我的 mongo db 数据库上创建搜索。我认为一个不错的选择是使用弹性搜索。所以我在aws elastic search上启动了一个集群。因为我有这个用于开发目的的弹性搜索,所以我已将访问策略设置为对域进行开放访问。
this.es_connection = new elasticsearch.Client("elastic search end point as given on aws es domain page");
this.es_connection.ping(
{
requestTimeout: 30000,
hello: 'elasticsearch'
},
function(error) {
if (error) {
console.error('elasticsearch cluster is down!' + JSON.stringify(error));
} else {
logger.info('All is well in elasticsearch');
}
}
);
检查我正在尝试在 npm 上 ping usgin elascticsearch 包。我没有获得实时连接。节点服务器在本地主机上运行。当我从自己的浏览器访问端点 url 时,我收到了成功消息。
如何将 aws es 服务与 mongoosastic 一起使用,我一直没有收到任何活动连接错误。如果 AWS/ES 是一个休息 api,我如何将它与 mongoosastic 一起使用。