org.apache.lucene.benchmark.standard
Class StandardBenchmarker
- Benchmarker
public class StandardBenchmarker
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.
org.apache.lucene.benchmark.standard.StandardBenchmarker.benchmark(java.io.File, org.apache.lucene.benchmark.BenchmarkOptions)
TestData[] | benchmark(File workingDir, BenchmarkOptions opts) - Benchmark according to the implementation, using the workingDir as the place to store things.
|
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.
|
INDEX_DIR
public static final String INDEX_DIR
SOURCE_DIR
public static final String SOURCE_DIR
StandardBenchmarker
public StandardBenchmarker()
benchmark
public TestData[] benchmark(File workingDir,
BenchmarkOptions opts)
throws Exception
Benchmark according to the implementation, using the workingDir as the place to store things.
- benchmark in interface Benchmarker
workingDir
- The File
directory to store temporary data in for running the benchmark
createQueries
public static Query[] createQueries(List qs,
Analyzer a)
Parse the strings containing Lucene queries.
qs
- array of strings containing query expressionsa
- analyzer to use when parsing queries
getAllFiles
public static void getAllFiles(File srcDir,
FileFilter filter,
List allFiles)
getSourceDirectory
protected File getSourceDirectory(File workingDir)
makeDocument
protected Document makeDocument(File in,
String[] tags,
boolean stored,
boolean tokenized,
boolean tfv)
throws Exception
Parse the Reuters SGML and index:
Date, Title, Dateline, Body
makeIndex
protected void makeIndex(TestRunData trd,
File srcDir,
IndexWriter iw,
boolean stored,
boolean tokenized,
boolean tfv,
StandardOptions options)
throws Exception
Make index, and collect time data.
trd
- run data to populatesrcDir
- directory with source filesiw
- index writer, already openstored
- store values of fieldstokenized
- tokenize fieldstfv
- store term vectors
reset
protected void reset(File indexDir)
throws Exception
Remove existing index.
runBenchmark
protected void runBenchmark(TestData params,
StandardOptions options)
throws Exception
Run benchmark using supplied parameters.
params
- benchmark parameters
saveStream
protected void saveStream(InputStream is,
File out,
boolean closeInput)
throws Exception
Save a stream to a file.
is
- input streamout
- output filecloseInput
- if true, close the input stream when done.
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.