From 3bbfa450e4e87f1adc316e6cc1207a6172fc3ea0 Mon Sep 17 00:00:00 2001 From: Steven Rowe Date: Thu, 31 Mar 2011 21:03:18 +0000 Subject: [PATCH] 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 --- .../org/apache/lucene/benchmark/byTask/tasks/ReadTask.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java b/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java index 414cf23c4c6..8c30924d2ce 100644 --- a/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java +++ b/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java @@ -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); }