Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/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
solr查询返回长度为1的doclist,尽管numfound大于1_Solr - Fatal编程技术网

solr查询返回长度为1的doclist,尽管numfound大于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,

当使用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,
      "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