LUCENE-2058: specify trec_eval output file from commandline

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@835674 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2009-11-13 00:41:53 +00:00
parent c4122adebf
commit 149a0c9b25
2 changed files with 14 additions and 2 deletions

View File

@ -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)

View File

@ -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