Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.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

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
Search Solr-按字段获取每个月的计数_Search_Solr_Lucene_Solr4_Faceted Search - Fatal编程技术网

Search Solr-按字段获取每个月的计数

Search Solr-按字段获取每个月的计数,search,solr,lucene,solr4,faceted-search,Search,Solr,Lucene,Solr4,Faceted Search,我需要得到每年按公司分组的结果。 我尝试了以下查询: http://localhost:8080/solr/select?q=&fq=status_created_at:[2011-12-31T4:00:00Z TO 2016-04-13T4:00:00Z] AND -company:(20 26 27 536)&facet=true&facet.field=company&facet.date=status_created_at&facet.date.s

我需要得到每年按公司分组的结果。 我尝试了以下查询:

http://localhost:8080/solr/select?q=&fq=status_created_at:[2011-12-31T4:00:00Z TO 2016-04-13T4:00:00Z] AND -company:(20 26 27 536)&facet=true&facet.field=company&facet.date=status_created_at&facet.date.start=2012-01-01T4:00:00Z&facet.date.end=2016-4-12T4:00:00Z&facet.date.gap=+1MONTH&fl=id&wt=json&rows=0&start=0&defType=dismax&qf=text
我希望结果会像这样回来

{ 2015: {"1":123, "2":412}, 2014: {"1":123, "2":412}, } 
但是查询没有给出预期的结果。我知道我的要求是组合
分组
+
分面
,但不知道如何微调查询

帮我解决这个问题