FileDocCategorySizeDatePackage
CreateIndexTask.javaAPI DocApache Lucene 2.1.01964Wed Feb 14 10:46:14 GMT 2007org.apache.lucene.benchmark.byTask.tasks

CreateIndexTask

public class CreateIndexTask extends PerfTask
Create an index. Other side effects: index writer object in perfRunData is set.

Fields Summary
Constructors Summary
public CreateIndexTask(org.apache.lucene.benchmark.byTask.PerfRunData runData)

    super(runData);
  
Methods Summary
public intdoLogic()

    Directory dir = getRunData().getDirectory();
    Analyzer analyzer = getRunData().getAnalyzer();
    
    IndexWriter iw = new IndexWriter(dir, analyzer, true);
    
    Config config = getRunData().getConfig();
    
    boolean cmpnd = config.get("compound",true);
    int mrgf = config.get("merge.factor",10);
    int mxbf = config.get("max.buffered",10);

    iw.setUseCompoundFile(cmpnd);
    iw.setMergeFactor(mrgf);
    iw.setMaxBufferedDocs(mxbf);

    getRunData().setIndexWriter(iw);
    return 1;