javascript - 如何使用elastic.js获取 Elasticsearch 上的所有索引?

标签 javascript json angularjs elasticsearch

通过我的 Angular 应用程序,我需要显示 Elasticsearch 上的所有索引。我可以使用文档查询特定索引,但无法获取 Elasticsearch 上的所有索引。

这是Documentation

这是我的代码:

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

最佳答案

  const indices = await client.cat.indices({format: 'json'})

关于javascript - 如何使用elastic.js获取 Elasticsearch 上的所有索引?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28081200/

相关文章:

javascript - 按下浏览器的后退/前进按钮时显示自定义弹出窗口

jquery - JSON 和 jqGrid。 "userdata"是什么?

jquery - 将 JSON 编码的 AJAX 内容加载到 jQuery UI 选项卡中

angularjs - 在 Angular 指令中传递 ng 类条件

angularjs - 如何在 Visual Studio Code 中使用 Typescript 和 Jasmine 框架编写 Protractor 测试脚本?

javascript - 如何使用javascript获取没有任何html的纯文本网页?

javascript - AngularJs 与 Google map

javascript - 使用 django 和 angularjs 渲染 html 模板时出现 TemplateSyntaxError

javascript - Jquery 文本区域中的 Linkify

python - 如何使用 python 将列表中的信息填充到多个 JSON 对象中?