mirror of https://github.com/apache/lucene.git
SOLR-236: fix bug where numFound was always zero if group.offset and group.limit were both zero.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1065406 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e7088279f7
commit
146c27063f
|
@ -77,10 +77,11 @@ public class Grouping {
|
|||
int docsToCollect = getMax(off, len, max);
|
||||
|
||||
// TODO: implement a DocList impl that doesn't need to start at offset=0
|
||||
TopDocs topDocs = collector.topDocs(0, docsToCollect);
|
||||
TopDocs topDocs = collector.topDocs(0, Math.max(docsToCollect,1)); // 0 isn't supported as a valid value
|
||||
int docsCollected = Math.min(docsToCollect, topDocs.scoreDocs.length);
|
||||
|
||||
int ids[] = new int[topDocs.scoreDocs.length];
|
||||
float[] scores = needScores ? new float[topDocs.scoreDocs.length] : null;
|
||||
int ids[] = new int[docsCollected];
|
||||
float[] scores = needScores ? new float[docsCollected] : null;
|
||||
for (int i=0; i<ids.length; i++) {
|
||||
ids[i] = topDocs.scoreDocs[i].doc;
|
||||
if (scores != null)
|
||||
|
|
Loading…
Reference in New Issue