org.apache.cocoon.components.search.components.impl
Class DefaultIndexerImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.search.components.impl.AbstractIndexer
          extended by org.apache.cocoon.components.search.components.impl.DefaultIndexerImpl
All Implemented Interfaces:
org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, Indexer

public class DefaultIndexerImpl
extends AbstractIndexer
implements org.apache.avalon.framework.configuration.Configurable

Author:
Nicolas Maisonneuve

Field Summary
static java.lang.String DOCUMENT_BUFFERED_NUM_ELEMENT
          Buffer size is element
 
Fields inherited from class org.apache.cocoon.components.search.components.impl.AbstractIndexer
add_writer, analyzer, clear_mode, delete_reader, dir, mergeFactor
 
Fields inherited from interface org.apache.cocoon.components.search.components.Indexer
DOCUMENT_UID_FIELD, ROLE
 
Constructor Summary
DefaultIndexerImpl()
           
 
Method Summary
protected  void addDocument(org.apache.lucene.document.Document doc)
           
 void configure(org.apache.avalon.framework.configuration.Configuration conf)
           
protected  void release()
          releasing resources
 void setBufferSize(int value)
          Set the maximum number of buffered documents to avoid to open and close the IndexWriter a lot of times
protected  void updateDocument(org.apache.lucene.document.Document doc)
           
 
Methods inherited from class org.apache.cocoon.components.search.components.impl.AbstractIndexer
addDocument, clearIndex, closeReader, closeWriter, del, deleteDocument, getAnalyzer, getIndex, getMergeFactor, index, openIndexReader, openIndexWriter, optimize, recycle, setAnalyzer, setIndex, setMergeFactor, switchToADD_MODE, switchToDEL_MODE
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCUMENT_BUFFERED_NUM_ELEMENT

public static final java.lang.String DOCUMENT_BUFFERED_NUM_ELEMENT
Buffer size is element

See Also:
Constant Field Values
Constructor Detail

DefaultIndexerImpl

public DefaultIndexerImpl()
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration conf)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

setBufferSize

public void setBufferSize(int value)
Set the maximum number of buffered documents to avoid to open and close the IndexWriter a lot of times

Parameters:
value - int number (default 100)

release

protected final void release()
                      throws IndexException
Description copied from class: AbstractIndexer
releasing resources

Overrides:
release in class AbstractIndexer
Throws:
IndexException

addDocument

protected final void addDocument(org.apache.lucene.document.Document doc)
                          throws IndexException
Specified by:
addDocument in class AbstractIndexer
Throws:
IndexException

updateDocument

protected final void updateDocument(org.apache.lucene.document.Document doc)
                             throws IndexException
Specified by:
updateDocument in class AbstractIndexer
Throws:
IndexException


Copyright © $ Apache Software Foundation. All Rights Reserved.