【问题标题】:Elasticsearch - Use wildcard in Multi Get Java APIElasticsearch - 在 Multi Get Java API 中使用通配符
【发布时间】:2018-10-10 12:37:19
【问题描述】:

在 Elasticsearch 中,有没有办法使用通配符从 Java API 中的多个索引中获取文档?例如,目前我必须使用 prepareMultiGet 如下:

MultiGetResponse multiGetItemResponses = client.prepareMultiGet()
.add("index_01", "index_01", "foo")
.add("index_02", "index_02", "foo")
.add("index_03", "index_03", "foo")
.get();

我可以只使用通配符索引名称,例如 index_* 从索引中获取文档吗?

【问题讨论】:

  • 虽然我不是用 Java 而是用 C# 编写的,但是在 NEST(C# 的弹性 API)中是可能的,所以我很确定它在 java 中是可能的。最后,这个 API 所做的就是将您的查询转换为适用于 Elastic Rest API 的 json

标签: elasticsearch


【解决方案1】:

文档级别的所有 CRUD API 都是单索引 API。所以看起来我不能使用通配符作为索引名称。

https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-docs.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-17
    相关资源
    最近更新 更多