mirror of https://github.com/apache/lucene.git
LUCENE-2119: use numDocs() not maxDoc() as max nDocs we pass to PQ
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@887803 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ae72952fa4
commit
470c89a2b2
|
@ -164,7 +164,7 @@ public class IndexSearcher extends Searcher {
|
||||||
throw new IllegalArgumentException("nDocs must be > 0");
|
throw new IllegalArgumentException("nDocs must be > 0");
|
||||||
}
|
}
|
||||||
|
|
||||||
nDocs = Math.min(nDocs, reader.maxDoc());
|
nDocs = Math.min(nDocs, reader.numDocs());
|
||||||
|
|
||||||
TopScoreDocCollector collector = TopScoreDocCollector.create(nDocs, !weight.scoresDocsOutOfOrder());
|
TopScoreDocCollector collector = TopScoreDocCollector.create(nDocs, !weight.scoresDocsOutOfOrder());
|
||||||
search(weight, filter, collector);
|
search(weight, filter, collector);
|
||||||
|
@ -192,7 +192,7 @@ public class IndexSearcher extends Searcher {
|
||||||
Sort sort, boolean fillFields)
|
Sort sort, boolean fillFields)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
nDocs = Math.min(nDocs, reader.maxDoc());
|
nDocs = Math.min(nDocs, reader.numDocs());
|
||||||
|
|
||||||
TopFieldCollector collector = TopFieldCollector.create(sort, nDocs,
|
TopFieldCollector collector = TopFieldCollector.create(sort, nDocs,
|
||||||
fillFields, fieldSortDoTrackScores, fieldSortDoMaxScore, !weight.scoresDocsOutOfOrder());
|
fillFields, fieldSortDoTrackScores, fieldSortDoMaxScore, !weight.scoresDocsOutOfOrder());
|
||||||
|
|
Loading…
Reference in New Issue