edu.mayo.informatics.indexer.lucene
Class LuceneRAMBatchIndexWriter

java.lang.Object
  extended by edu.mayo.informatics.indexer.lucene.LuceneRAMBatchIndexWriter
All Implemented Interfaces:
LuceneIndexWriterInterface

public class LuceneRAMBatchIndexWriter
extends java.lang.Object
implements LuceneIndexWriterInterface

Indexes documents into a RAMDirectory, and then flushes the RAMDirectory to disk when docsPerTempIndex_ is reached. Gives small speed gains over a standard FSDirectory.

Author:
Dan Armbrust

Constructor Summary
LuceneRAMBatchIndexWriter(java.io.File location, boolean clearContents, org.apache.lucene.analysis.Analyzer analyzer)
           
 
Method Summary
 void addDocument(org.apache.lucene.document.Document document)
           
 void addDocument(org.apache.lucene.document.Document document, org.apache.lucene.analysis.Analyzer analyzer)
           
 void close()
           
protected  void finalize()
           
 void optimize()
           
 void setDocsPerTempIndex(int i)
           
 void setMaxBufferedDocs(int i)
           
 void setMaxFieldLength(int i)
           
 void setMaxMergeDocs(int i)
           
 void setMergeFactor(int i)
           
 void setUseCompoundFile(boolean bool)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneRAMBatchIndexWriter

public LuceneRAMBatchIndexWriter(java.io.File location,
                                 boolean clearContents,
                                 org.apache.lucene.analysis.Analyzer analyzer)
                          throws InternalIndexerErrorException
Throws:
InternalIndexerErrorException
Method Detail

close

public void close()
           throws InternalIndexerErrorException
Specified by:
close in interface LuceneIndexWriterInterface
Throws:
InternalIndexerErrorException

addDocument

public void addDocument(org.apache.lucene.document.Document document)
                 throws InternalIndexerErrorException
Specified by:
addDocument in interface LuceneIndexWriterInterface
Throws:
InternalIndexerErrorException

addDocument

public void addDocument(org.apache.lucene.document.Document document,
                        org.apache.lucene.analysis.Analyzer analyzer)
                 throws InternalIndexerErrorException
Specified by:
addDocument in interface LuceneIndexWriterInterface
Throws:
InternalIndexerErrorException

setDocsPerTempIndex

public void setDocsPerTempIndex(int i)
Specified by:
setDocsPerTempIndex in interface LuceneIndexWriterInterface
Parameters:
i -

setMaxFieldLength

public void setMaxFieldLength(int i)
Specified by:
setMaxFieldLength in interface LuceneIndexWriterInterface
Parameters:
i -

setMaxMergeDocs

public void setMaxMergeDocs(int i)
Specified by:
setMaxMergeDocs in interface LuceneIndexWriterInterface
Parameters:
i -

setMaxBufferedDocs

public void setMaxBufferedDocs(int i)
Specified by:
setMaxBufferedDocs in interface LuceneIndexWriterInterface

setMergeFactor

public void setMergeFactor(int i)
Specified by:
setMergeFactor in interface LuceneIndexWriterInterface
Parameters:
i -

setUseCompoundFile

public void setUseCompoundFile(boolean bool)
Specified by:
setUseCompoundFile in interface LuceneIndexWriterInterface

optimize

public void optimize()
              throws InternalIndexerErrorException
Specified by:
optimize in interface LuceneIndexWriterInterface
Throws:
InternalIndexerErrorException

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.