org.apache.lucene.benchmark.standard
public class StandardBenchmarker extends AbstractBenchmarker implements Benchmarker
Deprecated: use the byTask code instead. See http://lucene.zones.apache.org:8080/hudson/job/Lucene-Nightly/javadoc/org/apache/lucene/benchmark/byTask/package-summary.html .
Reads in the Reuters Collection, downloaded from http://www.daviddlewis.com/resources/testcollections/reuters21578/reuters21578.tar.gz in the workingDir/reuters and indexes them using the StandardAnalyzer Runs a standard set of documents through an Indexer and then runs a standard set of queries against the index.Field Summary | |
---|---|
static String | INDEX_DIR |
static String | SOURCE_DIR |
Constructor Summary | |
---|---|
StandardBenchmarker() |
Method Summary | |
---|---|
TestData[] | benchmark(File workingDir, BenchmarkOptions opts) |
static Query[] | createQueries(List qs, Analyzer a)
Parse the strings containing Lucene queries.
|
static void | getAllFiles(File srcDir, FileFilter filter, List allFiles) |
protected File | getSourceDirectory(File workingDir) |
protected Document | makeDocument(File in, String[] tags, boolean stored, boolean tokenized, boolean tfv)
Parse the Reuters SGML and index:
Date, Title, Dateline, Body
|
protected void | makeIndex(TestRunData trd, File srcDir, IndexWriter iw, boolean stored, boolean tokenized, boolean tfv, StandardOptions options)
Make index, and collect time data.
|
protected void | reset(File indexDir)
Remove existing index.
|
protected void | runBenchmark(TestData params, StandardOptions options)
Run benchmark using supplied parameters.
|
protected void | saveStream(InputStream is, File out, boolean closeInput)
Save a stream to a file.
|
Parameters: qs array of strings containing query expressions a analyzer to use when parsing queries
Returns: array of Lucene queries
Parameters: in input file
Returns: Lucene document
Parameters: trd run data to populate srcDir directory with source files iw index writer, already open stored store values of fields tokenized tokenize fields tfv store term vectors
Throws: Exception
Throws: Exception
Parameters: params benchmark parameters
Throws: Exception
Parameters: is input stream out output file closeInput if true, close the input stream when done.
Throws: Exception