你不会是程序猿吧?

嵌套查询问题

Elasticsearch | 作者 mcs41531 | 发布于2018年02月22日 | 阅读数:2926

会员索引里有个订单列表的嵌套文档,想查询一段时间内下单次数有3-5次的会员怎么样查?
类似mysql语句:
select union_id from user_table where xxx and union_id in (
select union_id from order_table where time>=1 and time<=100 and xxx group by union_id having count(*) between 3 and 5
)

 
 或者有没有其他的索引方案可以实现这样的查询?
 
 
已邀请:

aoliao_paopao

赞同来自:

你可以参考一下https://elasticsearch.cn/question/3415,我之前也遇到这种问题了

要回复问题请先登录注册