【发布时间】:2014-07-22 04:55:32
【问题描述】:
我正在使用 solrnet,我必须按一个字段“thisfield”对结果进行分组。在分组中我应该返回这个:
group=true&group.field=thisfield&group.limit=100
在我的代码中我使用这个:
Grouping = new GroupingParameters()
{
Fields = new[] { "thisfield" },
Format = GroupingFormat.Grouped,
Limit = 100,
},
但是这段代码什么也没给我,我的问题在哪里?有什么想法吗?
来自腻子的更多信息:
我需要得到这个: 信息:webapp=/solr path=/select params={sort=sequentialid+desc,exchangetimestamp+desc&indent=true&q=destination:LUKA+OR+sender:LUKA&group.limit=100&_=1401690365440&group.field=breadcrumbid&group=true&wt=xml} 点击=539927 状态=0 QTime=76
我知道了: INFO: webapp=/solr path=/select params={group.format=grouped&sort=sequentialid+desc,exchangetimestamp+desc&start=0&q=((((destination:LUKA))+OR+((sender:LUKA))))&group .limit=100&group.field=breadcrumbid&group=true&version=2.2&rows=15} hits=539927 status=0 QTime=76
【问题讨论】:
-
Limit = 100,应该是Limit = 100? -
没有差异,逗号在最后一行并不重要,我可以有,也可以没有。
-
也许您没有将
Grouping参数分配给查询?你能发布整个options设置吗? -
选项设置?你的意思是我从日志中得到的结果吗,我在问题中从腻子中发布。第一个结果来自我的 Solr 管理员,第二个来自我的应用程序。
-
好吧,我知道了,我的代码没有问题,问题在于我返回的是 List 而不是 Group。