我使用elastic search进行用户搜索。我有一份这样的文件。
{
"uid":1,
"fullname": "xxxx",
"order_info": [
{"order_id":1, "create_time":"2018-01-01"},
{"order_id":2, "create_time":"2019-01-01"},
{"order_id":3, "create_time":"2019-02-01"}
]
}
我能得到像这样的sql文档吗?
select * from member_info where id in (
select member_id from order_info where create_time > '2019-01-01' group by
uid having count(*) > 3
);
发布于 2019-04-14 17:17:32
您将需要使用Post Filter聚合。
时,使用post_filter查询获取结果
或
只需使用Elasticsearch SQL REST API
参考文献:
https://stackoverflow.com/questions/55673626
复制相似问题