我有一个别名指向两个索引。我想使用别名名称搜索文档,而不是传递两个索引名称并获取结果。
范例:
像这样:SearchResponse response = client.prepareSearch(“alias”)
不像这样:SearchResponse响应= client.prepareSearch(“index1”,“index2”)
最佳答案
只需将索引名替换为别名即可,并以相同的方式使用它。
关于search - 在ElasticSearch中搜索使用别名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34941570/