Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 使用group by和having子句进行Solr搜索以进行报告_Mysql_Solr_Lucene_Reporting_Solr4 - Fatal编程技术网

Mysql 使用group by和having子句进行Solr搜索以进行报告

Mysql 使用group by和having子句进行Solr搜索以进行报告,mysql,solr,lucene,reporting,solr4,Mysql,Solr,Lucene,Reporting,Solr4,我在solr中添加了大约2000万个关于下表结构的文档 id |手机|金额|零售商|时间戳 现在我需要那些充电超过x次的手机号码 当我在mysql中需要这些结果时,我会在下面的查询中选择mobile,countmobile as total from table group by mobile have total>x 如何在solr中获得相同的结果?我已经尝试过选择?q=%3A&wt=json&indent=true&group=true&group.field=mobile,但它提供了mob

我在solr中添加了大约2000万个关于下表结构的文档

id |手机|金额|零售商|时间戳

现在我需要那些充电超过x次的手机号码

当我在mysql中需要这些结果时,我会在下面的查询中选择mobile,countmobile as total from table group by mobile have total>x

如何在solr中获得相同的结果?我已经尝试过选择?q=%3A&wt=json&indent=true&group=true&group.field=mobile,但它提供了mobile[grouped]与numcount的所有记录,但如何向numcount添加限制[在mysql中有having子句]


我最近开始使用solr进行报告,所以我使用solr进行此类查询的方向是否正确,或者是否有其他工具/技术/方法来处理此类报告查询,因为mysql挂起了2000万条记录。此外,在未来,我的数据最多可以增加1亿次

您可以通过faceting实现这一点:

选择?q=%3A*&wt=json&facet=true&facet.field=mobile&facet.mincount=100*

然后在响应中查找facet_计数

这应该可以很好地工作,包括非常大的索引