net.ontopia.topicmaps.impl.utils
Class FulltextIndexManager
java.lang.Object
net.ontopia.topicmaps.impl.utils.AbstractIndex
net.ontopia.topicmaps.impl.utils.BasicIndex
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.
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
FulltextIndexManager
protected FulltextIndexManager(TopicMapIF topicmap)
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.