net.ontopia.topicmaps.impl.utils
Class FulltextIndexManager

java.lang.Object
  extended by net.ontopia.topicmaps.impl.utils.AbstractIndex
      extended by net.ontopia.topicmaps.impl.utils.BasicIndex
          extended by net.ontopia.topicmaps.impl.utils.FulltextIndexManager
All Implemented Interfaces:
SearcherIF, IndexIF, EventListenerIF

public class FulltextIndexManager
extends BasicIndex
implements SearcherIF

INTERNAL: The indexer manager will keep track of base names, variants and occurrences that are changed in the topic map. These fulltext index can later be synchronized through the synchronizeIndex method.


Nested Class Summary
 
Nested classes/interfaces inherited from class net.ontopia.topicmaps.impl.utils.BasicIndex
BasicIndex.EventHandler
 
Field Summary
protected  java.util.Collection<TMObjectIF> added
           
protected  java.util.Collection<TMObjectIF> changed
           
protected  TopicMapDocumentGeneratorIF docgen
           
protected  org.apache.lucene.store.Directory luceneDirectory
           
protected  SearcherIF luceneSearcher
           
protected  java.util.Collection<java.lang.String> removed
           
 
Fields inherited from class net.ontopia.topicmaps.impl.utils.BasicIndex
handlers
 
Constructor Summary
protected FulltextIndexManager(TopicMapIF topicmap)
           
 
Method Summary
 void close()
          INTERNAL: Releases resources associated with this searcher.
static FulltextIndexManager manageTopicMap(TopicMapIF topicmap)
          INTERNAL: Registers the fulltext index manager with the event system of the specified topic map.
 boolean needSynchronization()
          INTERNAL: Returns true if index manager has seen changes to the topic map, so that the index must be updated.
protected  void objectAdded(java.lang.Object object)
           
protected  void objectChanged(java.lang.Object object)
           
protected  void objectRemoved(java.lang.Object object)
           
 SearchResultIF search(java.lang.String query)
          INTERNAL: Performs a query on an index.
 void setLuceneDirectory(org.apache.lucene.store.Directory luceneDirectory)
           
 boolean synchronizeIndex(IndexerIF indexer)
          INTERNAL: Applies all changes made to the topic map to the specified fulltext indexer.
 
Methods inherited from class net.ontopia.topicmaps.impl.utils.BasicIndex
getIndex, processEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

luceneDirectory

protected org.apache.lucene.store.Directory luceneDirectory

luceneSearcher

protected SearcherIF luceneSearcher

added

protected java.util.Collection<TMObjectIF> added

removed

protected java.util.Collection<java.lang.String> removed

changed

protected java.util.Collection<TMObjectIF> changed

docgen

protected TopicMapDocumentGeneratorIF docgen
Constructor Detail

FulltextIndexManager

protected FulltextIndexManager(TopicMapIF topicmap)
Method Detail

manageTopicMap

public static FulltextIndexManager manageTopicMap(TopicMapIF topicmap)
INTERNAL: Registers the fulltext index manager with the event system of the specified topic map.

Parameters:
topicmap -
Returns:
The index manager for specified topicmap

setLuceneDirectory

public void setLuceneDirectory(org.apache.lucene.store.Directory luceneDirectory)

needSynchronization

public boolean needSynchronization()
INTERNAL: Returns true if index manager has seen changes to the topic map, so that the index must be updated.

Returns:
True if index must be updated.

synchronizeIndex

public boolean synchronizeIndex(IndexerIF indexer)
                         throws java.io.IOException
INTERNAL: Applies all changes made to the topic map to the specified fulltext indexer.

Parameters:
indexer - The fulltext indexer to synchronize against.
Returns:
True if the index was modified.
Throws:
java.io.IOException

search

public SearchResultIF search(java.lang.String query)
                      throws java.io.IOException
Description copied from interface: SearcherIF
INTERNAL: Performs a query on an index. The actual query syntax is search engine dependent.

Specified by:
search in interface SearcherIF
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Description copied from interface: SearcherIF
INTERNAL: Releases resources associated with this searcher.

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

objectAdded

protected void objectAdded(java.lang.Object object)

objectRemoved

protected void objectRemoved(java.lang.Object object)

objectChanged

protected void objectChanged(java.lang.Object object)


Copyright © 2000-2012 Ontopia.