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.
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 Collection<TMObjectIF> added
removed
protected Collection<String> removed
changed
protected 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 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:
IOException
search
public SearchResultIF search(String query)
throws 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:
IOException
close
public void close()
throws IOException
- Description copied from interface:
SearcherIF
- INTERNAL: Releases resources associated with this searcher.
- Specified by:
close
in interface SearcherIF
- Throws:
IOException
objectAdded
protected void objectAdded(Object object)
objectRemoved
protected void objectRemoved(Object object)
objectChanged
protected void objectChanged(Object object)
Copyright © 2000-2012 Ontopia.