通过我的 Angular 应用程序,我需要显示 Elasticsearch 上的所有索引。我可以使用文档查询特定索引,但无法获取 Elasticsearch 上的所有索引。
这是我的代码:
$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/