我有一个示例架构,例如:
id:1,date:2012-05-01,parent:p1
id:1,date:2012-05-01,parent:p2
id:1,date:2012-05-01,parent:p3
id:1,date:2012-05-02,parent:p1
id:1,date:2012-05-02,parent:p4
我想对“日期”进行范围查询,并知道每天有多少新/独特的父母发生。换句话说,我想看看随着时间的推移增加了多少新父母。对于给定的数据,输出应如下所示:
2012-04-31:0 (no parents existed an that time)
2012-05-01:3 (because three new parents occured at 2012-05-01: p1,p2,p3)
2012-05-02:4 (which is 3 parents from 2012-05-01 and 1 new unique parent p4 occured at 2012-05-02 which gives a total of 4)
2012-05-03:4 (no new parent was added this day...)
这种查询甚至可以在 SOLR 中进行吗?