Node.js上特定索引的Elasticsearch快照失败

Snapshot in Elasticsearch of a specific index failing on Node.js

本文关键字:Elasticsearch 快照 失败 索引 js Node      更新时间:2023-09-26

我试图使用官方node.js模块中的indexes参数创建单个索引的快照,但最终总是获得集群的完整快照。

@es.snapshot.create( 
   { snapshot: "#{uid}", indices: index, repository: @config.esrepo, include_global_state: false }
   ( err, created ) -> 
      ...
      ...
)

上面的咖啡脚本转换成这样:

_this.es.snapshot.create({
            snapshot: uid,
            indices: index,
            repository: _this.config.esrepo,
            include_global_state: false
          }, function(err, created) {
              .....
          });

这是由于es客户端中的错误或缺少功能造成的吗?API中描述了索引参数,但JS客户端API中没有。。。?

一个简单的错误-真是太遗憾了。indices参数必须是body的一部分,而我的请求中却缺少它。