如何使用 elastic.js 获取弹性搜索的所有索引?

Saj*_*ran 1 javascript json elasticsearch angularjs

使用我的 angular 应用程序,我需要在弹性搜索上显示所有索引。我可以使用文档查询特定索引,但无法获取弹性搜索上的所有索引。

这里是 Documentation

这是我的代码:

$scope.getallIndex = function(){
         $scope.Indexes =  ejs.Request().query(ejs.MatchAllQuery()
            .doSearch().then(function (body) {
         $scope.Indexes = body.hits.hits;
          console.log($scope.Indexes);       
        }
Run Code Online (Sandbox Code Playgroud)

zag*_*art 7

  const indices = await client.cat.indices({format: 'json'})
Run Code Online (Sandbox Code Playgroud)