lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r887803 - /lucene/java/trunk/src/java/org/apache/lucene/search/IndexSearcher.java
Date Sun, 06 Dec 2009 23:56:31 GMT
Author: mikemccand
Date: Sun Dec  6 23:56:31 2009
New Revision: 887803

URL: http://svn.apache.org/viewvc?rev=887803&view=rev
Log:
LUCENE-2119: use numDocs() not maxDoc() as max nDocs we pass to PQ

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/search/IndexSearcher.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/IndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/IndexSearcher.java?rev=887803&r1=887802&r2=887803&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/IndexSearcher.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/IndexSearcher.java Sun Dec  6 23:56:31
2009
@@ -164,7 +164,7 @@
       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());
     search(weight, filter, collector);
@@ -192,7 +192,7 @@
                              Sort sort, boolean fillFields)
       throws IOException {
 
-    nDocs = Math.min(nDocs, reader.maxDoc());
+    nDocs = Math.min(nDocs, reader.numDocs());
 
     TopFieldCollector collector = TopFieldCollector.create(sort, nDocs,
         fillFields, fieldSortDoTrackScores, fieldSortDoMaxScore, !weight.scoresDocsOutOfOrder());



Mime
View raw message