|
Jive Forums API (5.5.8) Developer Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jivesoftware.forum.database.DbSearchManager
public class DbSearchManager
Database implementation of SearchManager using the Lucene search package. Search indexes are stored in the "search" subdirectory of jiveHome.
Every 12 hours, a task will be run automatically to optimize the search index. Optimizes are also run right after index rebuilds.
| Field Summary | |
|---|---|
static java.lang.String |
BRAZILIAN_ANALYZER
The brazlian analyzer provides for stemming of words to allow for flexibility in searching when most content is in Brazilian. |
static java.lang.String |
CJK_ANALYZER
The CJK analyzer is a good choice for Chinese, Japanese and Korean. |
static java.lang.String |
CZECH_ANALYZER
The Czech analyzer provides a good choice for Czech |
static java.lang.String |
DANISH_ANALYZER
The danish analyzer provides for stemming of words to allow for flexibility in searching when most content is in Danish. |
static java.lang.String |
DUTCH_ANALYZER
The danish analyzer provides for stemming of words to allow for flexibility in searching when most content is in Danish. |
static java.lang.String |
ENGLISH_ANALYZER
The english analyzer provides for stemming of words to allow for flexibility in searching when most content is in English. |
static java.lang.String |
FINNISH_ANALYZER
The finnish analyzer provides for stemming of words to allow for flexibility in searching when most content is in Finnish. |
static java.lang.String |
FRENCH_ANALYZER
The french analyzer provides for stemming of words to allow for flexibility in searching when most content is in German. |
static java.lang.String |
GERMAN_ANALYZER
The german analyzer provides for stemming of words to allow for flexibility in searching when most content is in German. |
protected static org.apache.lucene.analysis.Analyzer |
indexerAnalyzer
The analyzer governs how words are tokenized. |
static java.lang.String |
ITALIAN_ANALYZER
The italian analyzer provides for stemming of words to allow for flexibility in searching when most content is in Italian. |
static java.lang.String |
NORWEGIAN_ANALYZER
The norwegian analyzer provides for stemming of words to allow for flexibility in searching when most content is in Norwegian. |
static java.lang.String |
PORTUGUESE_ANALYZER
The portuguese analyzer provides for stemming of words to allow for flexibility in searching when most content is in Portuguese. |
static java.lang.String |
RUSSIAN_ANALYZER
The russian analyzer provides for stemming of words to allow for flexibility in searching when most content is in Russian. |
protected static org.apache.lucene.analysis.Analyzer |
searcherAnalyzer
The analyzer governs how words are tokenized. |
protected static ReadWriteLock |
searcherLock
Lock object used for controlling searches while modifying the index |
static java.lang.String |
SPANISH_ANALYZER
The spanish analyzer provides for stemming of words to allow for flexibility in searching when most content is in Spanish. |
static java.lang.String |
STANDARD_ANALYZER
The standard analyzer provides good indexing for western languages. |
static java.lang.String |
SWEDISH_ANALYZER
The swedish analyzer provides for stemming of words to allow for flexibility in searching when most content is in Swedish. |
| Method Summary | |
|---|---|
protected void |
addMessageToIndex(com.jivesoftware.forum.database.DbSearchManager.MessageBean bean,
org.apache.lucene.index.IndexWriter writer)
Indexes an individual message. |
void |
addTextExtractor(java.lang.String className)
Installs a new class into the list of available text extractors for the system. |
void |
addToIndex(ForumMessage message)
Adds an individual message to the index. |
void |
addToIndex(ForumMessage message,
boolean cluster)
|
protected void |
deleteMessagesFromIndex(long[] messages,
org.apache.lucene.index.IndexReader reader)
Deletes a message from the index. |
void |
destroy()
Notifies the manager to release any resources that may be holding on too. |
void |
forumAdded(ForumEvent event)
Fired when a forum has been added to the system. |
void |
forumDeleted(ForumEvent event)
Fired when a forum is about to be deleted from the system. |
void |
forumMerged(ForumEvent event)
Fired when a forum is merged into another forum. |
void |
forumModified(ForumEvent event)
Fired when a forum is modified. |
void |
forumMoved(ForumEvent event)
Fired when a forum has been moved from one category to another. |
static java.lang.String |
getAnalyzer()
Returns the Lucene analyzer class that is be used for indexing. |
int |
getAutoIndexInterval()
Creates a new DbSearchIndexer. |
int |
getCurrentCount()
Returns the number of entries that have been indexed if an indexing operation is currently active (i.e., SearchManager.isBusy() returns true). |
static DbSearchManager |
getInstance()
|
java.util.Date |
getLastIndexedDate()
Returns the date that the last update to the index was made. |
int |
getPercentComplete()
Returns the percent complete that an indexing operation is if an indexing operation is currently active (i.e., SearchManager.isBusy() returns
true). |
static XMLJiveProperties |
getProperties()
|
TextExtractor[] |
getTextExtractors()
Returns the current array of TextExtractor objects. |
int |
getTotalCount()
Returns the total number of entries that are to be indexed if an indexing operation is currently active (i.e., SearchManager.isBusy() returns true). |
void |
initialize()
Initialize the manager. |
boolean |
isAttachmentSearchEnabled()
Returns true if the attachment search feature is turned on. |
boolean |
isAutoIndexEnabled()
Returns true if auto indexing is turned on. |
boolean |
isBusy()
Returns true if the search manager is currently busy with an search indexing task. |
boolean |
isFilterHTMLEnabled()
Determines whether to filter out HTML when indexing and retrieving messages. |
static boolean |
isSearchClusterEnabled()
Returns true when searches are being actually performed in the search cluster. |
boolean |
isSearchEnabled()
Returns true if the search feature is turned on. |
boolean |
isWildcardIgnored()
Returns true if wildcarding is disabled. |
void |
messageAdded(MessageEvent event)
Fired when a message has been added to the system. |
void |
messageDeleted(MessageEvent event)
Fired when a message is about to be deleted from the system. |
void |
messageModerationModified(MessageEvent event)
Fired when the moderation value of a message has been changed. |
void |
messageModified(MessageEvent event)
Fired when portions of a message have been modified. |
void |
messageMoved(MessageEvent event)
Fired when a message is moved to another thread. |
void |
messageRated(MessageEvent event)
Fired when a message has been rated. |
void |
optimize()
Optimizes the underlying search index for maximum speed. |
void |
rebuildIndex()
Manually rebuild the entire index. |
void |
removeFromIndex(Forum forum)
Removes a forum from the index. |
void |
removeFromIndex(Forum forum,
boolean cluster)
|
void |
removeFromIndex(ForumMessage message)
Removes an individual message from the index. |
void |
removeFromIndex(ForumMessage message,
boolean cluster)
|
void |
removeFromIndex(ForumThread thread)
Removes a thread from the index. |
void |
removeFromIndex(ForumThread thread,
boolean cluster)
|
void |
removeTextExtractor(java.lang.String className)
Removes an existing text extractor from the list of current text extractors. |
static void |
setAnalyzer(java.lang.String className)
Sets the Lucene analyzer class that is used for indexing. |
void |
setAttachmentSearchEnabled(boolean attachmentSearchEnabled)
Enables or disables the attachment search feature. |
void |
setAutoIndexEnabled(boolean enabled)
Enables or disables auto indexing. |
void |
setAutoIndexInterval(int minutes)
Sets the amount of time that indexer should wait between updating the index. |
void |
setFilterHTMLEnabled(boolean filterHTMLEnabled)
Set whether or not to index and display HTML within messages. |
void |
setSearchEnabled(boolean searchEnabled)
Enables or disables the search feature. |
void |
setWildcardIgnored(boolean value)
Turns on or off wildcarding. |
void |
threadAdded(ThreadEvent event)
Fired when a thread has been added to the system. |
void |
threadDeleted(ThreadEvent event)
Fired when a thread is about to be deleted from the system. |
void |
threadModerationModified(ThreadEvent event)
Fired when the moderation value of a thread has been changed. |
void |
threadMoved(ThreadEvent event)
Fired when a thread is moved from one foru to another. |
void |
threadRated(ThreadEvent event)
Fired when the thread has been rated. |
void |
updateIndex()
Manually update the index to include all new messages since the last update. |
protected void |
updateIndex(java.util.Date start,
java.util.Date end)
Updates the index. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String STANDARD_ANALYZER
public static final java.lang.String BRAZILIAN_ANALYZER
public static final java.lang.String CJK_ANALYZER
public static final java.lang.String CZECH_ANALYZER
public static final java.lang.String DANISH_ANALYZER
public static final java.lang.String DUTCH_ANALYZER
public static final java.lang.String ENGLISH_ANALYZER
public static final java.lang.String FINNISH_ANALYZER
public static final java.lang.String FRENCH_ANALYZER
public static final java.lang.String GERMAN_ANALYZER
public static final java.lang.String ITALIAN_ANALYZER
public static final java.lang.String NORWEGIAN_ANALYZER
public static final java.lang.String PORTUGUESE_ANALYZER
public static final java.lang.String RUSSIAN_ANALYZER
public static final java.lang.String SPANISH_ANALYZER
public static final java.lang.String SWEDISH_ANALYZER
protected static org.apache.lucene.analysis.Analyzer indexerAnalyzer
protected static org.apache.lucene.analysis.Analyzer searcherAnalyzer
protected static ReadWriteLock searcherLock
| Method Detail |
|---|
public static boolean isSearchClusterEnabled()
public static DbSearchManager getInstance()
public void initialize()
JiveManagerThis method is used internally by Jive during application startup and should not be called during normal usage of the class.
initialize in interface JiveManagerpublic void destroy()
JiveManager
destroy in interface JiveManagerpublic static XMLJiveProperties getProperties()
public static java.lang.String getAnalyzer()
public static void setAnalyzer(java.lang.String className)
className - the name of the analyzer class will be used for indexing.public int getAutoIndexInterval()
getAutoIndexInterval in interface SearchManagerpublic void setAutoIndexInterval(int minutes)
SearchManager
setAutoIndexInterval in interface SearchManagerminutes - the number of minutes between automatic index updates.public java.util.Date getLastIndexedDate()
SearchManager
getLastIndexedDate in interface SearchManagerpublic boolean isSearchEnabled()
SearchManager
isSearchEnabled in interface SearchManagerpublic void setSearchEnabled(boolean searchEnabled)
SearchManager
setSearchEnabled in interface SearchManagersearchEnabled - true to enable the search feature, false to disable.public boolean isAttachmentSearchEnabled()
SearchManager
isAttachmentSearchEnabled in interface SearchManagerpublic void setAttachmentSearchEnabled(boolean attachmentSearchEnabled)
SearchManager
setAttachmentSearchEnabled in interface SearchManagerattachmentSearchEnabled - true to enable attachment search.public boolean isFilterHTMLEnabled()
SearchManager
isFilterHTMLEnabled in interface SearchManagerpublic void setFilterHTMLEnabled(boolean filterHTMLEnabled)
SearchManager
setFilterHTMLEnabled in interface SearchManagerfilterHTMLEnabled - true if HTML should be filtered.public TextExtractor[] getTextExtractors()
SearchManager
getTextExtractors in interface SearchManager
public void addTextExtractor(java.lang.String className)
throws java.lang.ClassNotFoundException
SearchManager
addTextExtractor in interface SearchManagerclassName - the fully qualified name of the text extractor.
java.lang.ClassNotFoundException - if the class could not be loaded.
public void removeTextExtractor(java.lang.String className)
throws java.lang.ClassNotFoundException
SearchManager
removeTextExtractor in interface SearchManagerclassName - the fully qualified name of the text extractor to remove.
java.lang.ClassNotFoundException - if the class could not be loaded.public boolean isBusy()
SearchManagerSearchManager.rebuildIndex() will do nothing. If you'd like to query the status
of the indexing operation while the manager is busy, use the
SearchManager.getPercentComplete() method.
isBusy in interface SearchManagerpublic int getPercentComplete()
SearchManagerSearchManager.isBusy() returns
true). Valid percentages returned are from 0 to 100. If no indexing
operation is active, this method will return -1.
getPercentComplete in interface SearchManagerpublic int getTotalCount()
SearchManagerSearchManager.isBusy() returns true).
getTotalCount in interface SearchManagerpublic int getCurrentCount()
SearchManagerSearchManager.isBusy() returns true).
getCurrentCount in interface SearchManagerpublic boolean isWildcardIgnored()
SearchManager
isWildcardIgnored in interface SearchManagerpublic void setWildcardIgnored(boolean value)
SearchManager
setWildcardIgnored in interface SearchManagervalue - true if wildcards are to be ignored. false enables wildcard
search.public boolean isAutoIndexEnabled()
SearchManager
isAutoIndexEnabled in interface SearchManagerpublic void setAutoIndexEnabled(boolean enabled)
SearchManager
setAutoIndexEnabled in interface SearchManagerenabled - true to turn auto indexing on, false to turn it off.public void addToIndex(ForumMessage message)
SearchManager
addToIndex in interface SearchManagermessage - the message to add to the index.
public void addToIndex(ForumMessage message,
boolean cluster)
public void removeFromIndex(ForumMessage message)
SearchManager
removeFromIndex in interface SearchManagermessage - the message to remove from the index.
public void removeFromIndex(ForumMessage message,
boolean cluster)
public void removeFromIndex(ForumThread thread)
SearchManager
removeFromIndex in interface SearchManagerthread - the thread to remove from the index.
public void removeFromIndex(ForumThread thread,
boolean cluster)
public void removeFromIndex(Forum forum)
SearchManager
removeFromIndex in interface SearchManagerforum - the forum to remove from the index.
public void removeFromIndex(Forum forum,
boolean cluster)
public void updateIndex()
SearchManager
updateIndex in interface SearchManagerpublic void rebuildIndex()
SearchManager
rebuildIndex in interface SearchManagerpublic void optimize()
SearchManager
optimize in interface SearchManager
protected final void updateIndex(java.util.Date start,
java.util.Date end)
protected final void addMessageToIndex(com.jivesoftware.forum.database.DbSearchManager.MessageBean bean,
org.apache.lucene.index.IndexWriter writer)
throws java.io.IOException
java.io.IOException
protected final void deleteMessagesFromIndex(long[] messages,
org.apache.lucene.index.IndexReader reader)
throws java.io.IOException
java.io.IOExceptionpublic void messageAdded(MessageEvent event)
MessageListener
messageAdded in interface MessageListenerevent - the event object.public void messageDeleted(MessageEvent event)
MessageListener
messageDeleted in interface MessageListenerevent - the event object.public void messageModified(MessageEvent event)
MessageListener
messageModified in interface MessageListenerevent - the event object.public void messageModerationModified(MessageEvent event)
MessageListener
messageModerationModified in interface MessageListenerevent - the event object.public void messageRated(MessageEvent event)
MessageListener
messageRated in interface MessageListenerevent - the event object.public void messageMoved(MessageEvent event)
MessageListener
messageMoved in interface MessageListenerevent - the event object.public void threadAdded(ThreadEvent event)
ThreadListener
threadAdded in interface ThreadListenerevent - the event object.public void threadDeleted(ThreadEvent event)
ThreadListener
threadDeleted in interface ThreadListenerevent - the event object.public void threadMoved(ThreadEvent event)
ThreadListener
threadMoved in interface ThreadListenerevent - the event object.public void threadModerationModified(ThreadEvent event)
ThreadListener
threadModerationModified in interface ThreadListenerevent - the event object.public void threadRated(ThreadEvent event)
ThreadListener
threadRated in interface ThreadListenerevent - the event object.public void forumAdded(ForumEvent event)
ForumListener
forumAdded in interface ForumListenerevent - the event object.public void forumDeleted(ForumEvent event)
ForumListener
forumDeleted in interface ForumListenerevent - the event object.public void forumModified(ForumEvent event)
ForumListener
forumModified in interface ForumListenerevent - the event object.public void forumMoved(ForumEvent event)
ForumListener
forumMoved in interface ForumListenerevent - the event object.public void forumMerged(ForumEvent event)
ForumListener
forumMerged in interface ForumListenerevent - the event object.
|
Jive Forums Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||