当用分组字段查询solr时,我回复了" num_found"大于1,但" docs"属性仅显示1条记录。
查询类似于:
http://.../solr/.../select?q=*%3A*&fq=...&wt=json&indent=true&group=true&group.field=GroupingField_s&group.ngroups=true
结果如下:
"grouped": {
"GroupingField_s": {
"matches": 3130,
"ngroups": 283,
"groups": [
{
"groupValue": "1111",
"doclist": {
"numFound": 7,
"start": 0,
"docs": [ {/*only 1 record shown here*/} ]
},
{
"groupValue": "222",
"doclist": {
"numFound": 5,
"start": 0,
"docs": [ {/*only 1 record shown here*/} ]
}, ....
]
}
答案 0 :(得分:3)
您必须设置group.limit
参数。默认为1。
group.limit integer 指定要为每个组返回的结果数。默认值为1.
请参阅{{3}}。