Data includes:
this.config = config; // analyzer (default is standard analyzer) analyzer = (Analyzer) Class.forName(config.get("analyzer", "org.apache.lucene.analysis.standard.StandardAnalyzer")).newInstance(); // doc maker docMaker = (DocMaker) Class.forName(config.get("doc.maker", "org.apache.lucene.benchmark.byTask.utils.SimpleDocMaker")).newInstance(); docMaker.setConfig(config); // query makers // we use separate (identical) instances for each "read" task type, so each can iterate the quries separately. Class qmkrClass = Class.forName(config.get("query.maker","org.apache.lucene.benchmark.byTask.utils.SimpleQueryMaker")); searchQueryMaker = (QueryMaker) qmkrClass.newInstance(); searchQueryMaker.setConfig(config); searchTravQueryMaker = (QueryMaker) qmkrClass.newInstance(); searchTravQueryMaker.setConfig(config); searchTravRetQueryMaker = (QueryMaker) qmkrClass.newInstance(); searchTravRetQueryMaker.setConfig(config); // index stuff reinit(false); // statistic points points = new Points(config); if (Boolean.valueOf(config.get("log.queries","false")).booleanValue()) { System.out.println("------------> queries:"); System.out.println(getSearchQueryMaker().printQueries()); }
returnReturns the anlyzer. return analyzer;
return analyzer;
returnReturns the config. return config;
return config;
returnReturns the directory. return directory;
return directory;
returnReturns the docMaker. return docMaker;
return docMaker;
returnReturns the indexReader. return indexReader;
return indexReader;
returnReturns the indexWriter. return indexWriter;
return indexWriter;
returnReturns the points. return points;
return points;
returnReturns the searchQueryMaker. return searchQueryMaker;
return searchQueryMaker;
return searchTravQueryMaker;
return searchTravRetQueryMaker;
// cleanup index if (indexWriter!=null) { indexWriter.close(); indexWriter = null; } if (indexReader!=null) { indexReader.close(); indexReader = null; } if (directory!=null) { directory.close(); } // directory (default is ram-dir). if ("FSDirectory".equals(config.get("directory","RAMDirectory"))) { File workDir = new File("work"); File indexDir = new File(workDir,"index"); if (eraseIndex && indexDir.exists()) { FileUtils.fullyDelete(indexDir); } indexDir.mkdirs(); directory = FSDirectory.getDirectory(indexDir, eraseIndex); } else { directory = new RAMDirectory(); } // inputs resetInputs(); // release unused stuff System.runFinalization(); System.gc();
docMaker.resetInputs(); searchQueryMaker.resetInputs(); searchTravQueryMaker.resetInputs(); searchTravRetQueryMaker.resetInputs();
paramdirectory The directory to set. this.directory = directory;
this.directory = directory;
paramindexReader The indexReader to set. this.indexReader = indexReader;
this.indexReader = indexReader;
paramindexWriter The indexWriter to set. this.indexWriter = indexWriter;
this.indexWriter = indexWriter;