老师好,项目中需要用到es来实现数据统计,现在有这样一个需求不知道该如何实现,查了一下资料,也没有看到好的解决办法
现在有这样一组数据
[
{userId:1, name: 'liu', createTime:'2017-9-16', investMount: 1000, sex: 1},
{userId:1, name: 'liu', createTime:'2017-9-16', investMount: 2000, sex: 1},
{userId:1, name: 'liu', createTime:'2017-9-16', investMount: 3000, sex: 1},
{userId:2, name: 'wang', createTime:'2017-10-1', investMount: 1500, sex: 0},
{userId:3, name: 'zhang', createTime:'2017-10-14', investMount: 1800, sex: 1},
{userId:4, name: 'zhao', createTime:'2017-10-17', investMount: 4000, sex: 1}
]
比如:现在想查询注册时间(createTime)是2017-9-15到2017-10-15日之间,投资总额(同一个userId用户investMount的总和)在2000-5000之间的男性(sex==1)的用户,最后取到符合条件的userId的集合,这种需求该如何写DSL语句呢?
我现在对es的学习能力只能想到这一步