Updated to the new method for obtaining a top-level deleted docs bitset. Also checking the bitset for null, when there are no deleted docs.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1087435 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2011-03-31 21:03:18 +00:00
parent 56c2994f66
commit 3bbfa450e4
1 changed files with 3 additions and 2 deletions

View File

@ -30,6 +30,7 @@ import org.apache.lucene.benchmark.byTask.feeds.QueryMaker;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Fieldable;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.MultiFields;
import org.apache.lucene.search.Collector;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.search.MultiTermQuery;
@ -95,9 +96,9 @@ public abstract class ReadTask extends PerfTask {
// optionally warm and add num docs traversed to count
if (withWarm()) {
Document doc = null;
Bits delDocs = reader.getDeletedDocs();
Bits delDocs = MultiFields.getDeletedDocs(reader);
for (int m = 0; m < reader.maxDoc(); m++) {
if (!delDocs.get(m)) {
if (null == delDocs || ! delDocs.get(m)) {
doc = reader.document(m);
res += (doc == null ? 0 : 1);
}