Skip to content

Apache Lucene open-source search software

LUCENE-2058: specify trec_eval output file from commandline

Robert Muir149a0c9b2588
diff --git a/contrib/benchmark/CHANGES.txt b/contrib/benchmark/CHANGES.txt
index 0967ae98387..7e54436fb8a 100644
--- a/contrib/benchmark/CHANGES.txt
+++ b/contrib/benchmark/CHANGES.txt
@@ -4,6 +4,11 @@ The Benchmark contrib package contains code for benchmarking Lucene in a variety
$Id:$
+11/12/2009
+ LUCENE-2058: specify trec_eval submission output from the command line.
+ Previously, 4 arguments were required, but the third was unused. The
+ third argument is now the desired location of submission.txt (Robert Muir)
+
11/08/2009
LUCENE-2044: Added delete.percent.rand.seed to seed the Random instance
used by DeleteByPercentTask. (Mike McCandless)
diff --git a/contrib/benchmark/src/java/org/apache/lucene/benchmark/quality/trec/QueryDriver.java b/contrib/benchmark/src/java/org/apache/lucene/benchmark/quality/trec/QueryDriver.java
index 4296a865d38..bf2216455a1 100644
--- a/contrib/benchmark/src/java/org/apache/lucene/benchmark/quality/trec/QueryDriver.java
+++ b/contrib/benchmark/src/java/org/apache/lucene/benchmark/quality/trec/QueryDriver.java
@@ -38,10 +38,18 @@ import java.io.PrintWriter;
**/
public class QueryDriver {
public static void main(String[] args) throws Exception {
-
+ if (args.length != 4) {
+ System.err.println("Usage: QueryDriver <topicsFile> <qrelsFile> <submissionFile> <indexDir>");
+ System.err.println("topicsFile: input file containing queries");
+ System.err.println("qrelsFile: input file containing relevance judgements");
+ System.err.println("submissionFile: output submission file for trec_eval");
+ System.err.println("indexDir: index directory");
+ System.exit(1);
+ }
File topicsFile = new File(args[0]);
File qrelsFile = new File(args[1]);
+ SubmissionReport submitLog = new SubmissionReport(new PrintWriter(args[2]), "lucene");
FSDirectory dir = FSDirectory.open(new File(args[3]));
Searcher searcher = new IndexSearcher(dir, true);
@@ -66,7 +74,6 @@ public class QueryDriver {
// run the benchmark
QualityBenchmark qrun = new QualityBenchmark(qqs, qqParser, searcher, docNameField);
qrun.setMaxResults(maxResults);
- SubmissionReport submitLog = null;
QualityStats stats[] = qrun.execute(judge, submitLog, logger);
// print an avarage sum of the results