net.ontopia.infoset.fulltext.utils
Class DefaultIndexerManager

java.lang.Object
  extended by net.ontopia.infoset.fulltext.utils.DefaultIndexerManager
All Implemented Interfaces:
IndexerIF

public class DefaultIndexerManager
extends java.lang.Object
implements IndexerIF

INTERNAL: A standalone index manager that performs document processing and indexing processes in the current thread. No other threads are used.

Warning: The delete() method is not supported. Call the method on the nested indexer instead.


Field Summary
protected  IndexerIF indexer
           
protected  DocumentProcessorIF processor
           
 
Constructor Summary
DefaultIndexerManager(IndexerIF indexer)
          INTERNAL: Creates the manager and gives it the indexer used to do the actual indexing.
 
Method Summary
 void close()
          INTERNAL: Closes the indexer.
 void delete()
          INTERNAL: Deletes the index.
 int delete(java.lang.String field, java.lang.String value)
          INTERNAL: Removes all documents with the specified field value from the index.
 void flush()
          INTERNAL: Flushes all changes done to the index.
 DocumentProcessorIF getDocumentProcessor()
          INTERNAL: Gets the document processor used by the indexer manager.
 IndexerIF getIndexer()
          INTERNAL: Gets the nested indexer.
 void index(DocumentIF document)
          INTERNAL: Indexes the specified document.
 void setDocumentProcessor(DocumentProcessorIF processor)
          INTERNAL: Sets the document processor which is to be used by the indexer manager.
 void setIndexer(IndexerIF indexer)
          INTERNAL: Sets the nested indexer that is to be used by the indexer manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexer

protected IndexerIF indexer

processor

protected DocumentProcessorIF processor
Constructor Detail

DefaultIndexerManager

public DefaultIndexerManager(IndexerIF indexer)
INTERNAL: Creates the manager and gives it the indexer used to do the actual indexing.

Method Detail

getDocumentProcessor

public DocumentProcessorIF getDocumentProcessor()
INTERNAL: Gets the document processor used by the indexer manager.


setDocumentProcessor

public void setDocumentProcessor(DocumentProcessorIF processor)
INTERNAL: Sets the document processor which is to be used by the indexer manager.


getIndexer

public IndexerIF getIndexer()
INTERNAL: Gets the nested indexer.


setIndexer

public void setIndexer(IndexerIF indexer)
INTERNAL: Sets the nested indexer that is to be used by the indexer manager.


index

public void index(DocumentIF document)
           throws java.io.IOException
Description copied from interface: IndexerIF
INTERNAL: Indexes the specified document. This includes tokenizing, indexing and storing the document fields.

Specified by:
index in interface IndexerIF
Throws:
java.io.IOException

delete

public int delete(java.lang.String field,
                  java.lang.String value)
           throws java.io.IOException
Description copied from interface: IndexerIF
INTERNAL: Removes all documents with the specified field value from the index. This method should generally be, but is not limited to, used to delete documents by their identity field.

Specified by:
delete in interface IndexerIF
Returns:
The number of documents that was deleted from the index. -1 is return if this number is unknown.
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Description copied from interface: IndexerIF
INTERNAL: Flushes all changes done to the index. A flushing operation can include actions like persisting changes and optimizing the index.

Specified by:
flush in interface IndexerIF
Throws:
java.io.IOException

delete

public void delete()
            throws java.io.IOException
Description copied from interface: IndexerIF
INTERNAL: Deletes the index. The indexer is closed after this method returns. Note that some indexers might not support this operation.

Specified by:
delete in interface IndexerIF
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Description copied from interface: IndexerIF
INTERNAL: Closes the indexer. After the indexer has been closed it cannot (generally) be reopened.

Specified by:
close in interface IndexerIF
Throws:
java.io.IOException


Copyright © 2000-2012 Ontopia.