solr查询返回长度为1的doclist,尽管numfound大于1
当使用group by字段查询solr时,我发现“num_found”大于1的响应,但“docs”属性仅显示1条记录 查询类似于:solr查询返回长度为1的doclist,尽管numfound大于1,solr,Solr,当使用group by字段查询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,
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*/} ]
}, ....
]
}
结果如下:
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*/} ]
}, ....
]
}
您必须设置
group.limit
参数。这默认为1
group.limitinteger指定每个组要返回的结果数。默认值为1
看