不为失败找理由,要为成功找方法。

elasticsearch java如何查询一个索引的多个type下的数据

Elasticsearch | 作者 qqq1234567 | 发布于2018年10月21日 | 阅读数:5583

client.prepareSearch(indices)可以吗
已邀请:

rochy - rochy_he

赞同来自:

可以参考下面的案例:client.prepareSearch("index1", "index2") .setTypes("type1", "type2") 

fengzxia

赞同来自:

想要查询索引下的多个type,如楼上所写,如果不知道有哪些type可以直接不写setType这样可以查询索引下的所有type

要回复问题请先登录注册