我在 Elasticsearch 中有一个索引列表如下:
index1, index2, index3, test-index1, test-index2, test-index3
现在我只想要那些与我的模式“test-*”相匹配的索引。
我可以通过以下意义查询实现上述结果:
GET test-*/_aliases
我想通过 java 代码实现相同的结果。
最佳答案
响应 /test-*/_aliases
的 REST 端点执行以下操作 ( see here ):
GetAliasesResponse getAliasesResponse = client().admin().indices()
.prepareGetAliases()
.setIndices("test-*", "index-*").get();
关于java - 从 Elasticsearch 中获取索引名称匹配模式的列表 - JAVA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39405448/