gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 11:09:31 25 4
gpt4 key购买 nike

通过我的 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com