From a7973381886df8206a3494d02fd018dfedc91aa9 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Sat, 7 Nov 2009 21:10:38 +0000 Subject: [PATCH] LUCENE-2042: also print how many terms were searched, when the query is a MTQ git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@833762 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/benchmark/byTask/tasks/ReadTask.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java b/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java index 41089490181..bc11930f3c0 100644 --- a/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java +++ b/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java @@ -32,6 +32,7 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Fieldable; import org.apache.lucene.index.IndexReader; import org.apache.lucene.search.TopDocs; +import org.apache.lucene.search.MultiTermQuery; import org.apache.lucene.search.TopFieldCollector; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.IndexSearcher; @@ -114,6 +115,9 @@ public abstract class ReadTask extends PerfTask { final String printHitsField = getRunData().getConfig().get("print.hits.field", null); if (printHitsField != null && printHitsField.length() > 0) { final IndexReader r = searcher.getIndexReader(); + if (q instanceof MultiTermQuery) { + System.out.println("MultiTermQuery term count = " + ((MultiTermQuery) q).getTotalNumberOfTerms()); + } System.out.println("totalHits = " + hits.totalHits); System.out.println("maxDoc() = " + r.maxDoc()); System.out.println("numDocs() = " + r.numDocs());