solr 查询返回长度为 1 的文档列表,尽管 numfound 大于 1

solr query returning doclist of length 1, despite numfound being greater than 1

当用分组依据字段查询 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*/} ]
        }, ....
     ]
}

您必须设置 group.limit 参数。默认为 1。

group.limit integer Specifies the number of results to return for each group. The default value is 1.

参见Result Grouping