Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum
Interface SearchManager

All Known Implementing Classes:
DbSearchManager

public interface SearchManager

Manages the search feature of Jive Forums by defining properties of the search indexer. Indexing can either be done real-time by calling indexMessage() every time a new message is created, or by running the indexer in timed update mode. The latter mode is preferable since it allows for faster message posting.

The automated updating mode can be adjusted by setting how often batch indexing is done. You can adjust this interval to suit the needs of your forums. Frequent updates mean that messages will be searchable more quickly. Less frequent updates use fewer system resources.

If you are not using the Jive Forums search system at all (for example, if you have your own search technology that you'd rather use), you should disable the search feature entirely.

The following Jive properties correspond to the search manager settings:

See Also:
ForumFactory.getSearchManager()

Method Summary
 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.
 int getAutoIndexInterval()
          Returns the number of minutes that the indexer waits between each update.
 int getCurrentCount()
          Returns the number of entries that have been indexed if an indexing operation is currently active (i.e., isBusy() returns true).
 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., isBusy() returns true).
 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., isBusy() returns true).
 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.
 boolean isSearchEnabled()
          Returns true if the search feature is turned on.
 boolean isWildcardIgnored()
          Returns true if wildcarding is disabled.
 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(ForumMessage message)
          Removes an individual message from the index.
 void removeFromIndex(ForumThread thread)
          Removes a thread from the index.
 void removeTextExtractor(java.lang.String className)
          Removes an existing text extractor from the list of current text extractors.
 void setAttachmentSearchEnabled(boolean attachmentSearchEnabled)
          Enables or disables the attachment search feature.
 void setAutoIndexEnabled(boolean value)
          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 updateIndex()
          Manually update the index to include all new messages since the last update.
 

Method Detail

isSearchEnabled

boolean isSearchEnabled()
Returns true if the search feature is turned on. When search is disabled, other methods serve as no-ops and auto indexing will not occur.

Returns:
true if the search is enabled.

setSearchEnabled

void setSearchEnabled(boolean searchEnabled)
Enables or disables the search feature. When search is disabled, other methods serve as no-ops and auto indexing will not occur.

Parameters:
searchEnabled - true to enable the search feature, false to disable.

isAttachmentSearchEnabled

boolean isAttachmentSearchEnabled()
Returns true if the attachment search feature is turned on. When attachment search is disabled, attachment data is not indexed.

Returns:
true if the attachments search is enabled.

setAttachmentSearchEnabled

void setAttachmentSearchEnabled(boolean attachmentSearchEnabled)
Enables or disables the attachment search feature. When attachment search is disabled, attachment data is not indexed.

Parameters:
attachmentSearchEnabled - true to enable attachment search.

getTextExtractors

TextExtractor[] getTextExtractors()
Returns the current array of TextExtractor objects.

Returns:
an array of text extractors.

addTextExtractor

void addTextExtractor(java.lang.String className)
                      throws java.lang.ClassNotFoundException
Installs a new class into the list of available text extractors for the system. Exceptions are thrown if you're not a system administrator, the class can't be loaded from the classpath, or the class isn't an instance of TextExtractor.

Parameters:
className - the fully qualified name of the text extractor.
Throws:
java.lang.ClassNotFoundException - if the class could not be loaded.
java.lang.IllegalArgumentException - if the classname is not a TextExtractor or cannot be loaded.

removeTextExtractor

void removeTextExtractor(java.lang.String className)
                         throws java.lang.ClassNotFoundException
Removes an existing text extractor from the list of current text extractors.

Parameters:
className - the fully qualified name of the text extractor to remove.
Throws:
java.lang.ClassNotFoundException - if the class could not be loaded.
java.lang.IllegalArgumentException - if the classname is not a TextExtractor or cannot be loaded.

isBusy

boolean isBusy()
Returns true if the search manager is currently busy with an search indexing task. When busy, calls to index operations such as rebuildIndex() will do nothing. If you'd like to query the status of the indexing operation while the manager is busy, use the getPercentComplete() method.

Returns:
true if the search manager is currently busy with an index maintenance task.

getPercentComplete

int getPercentComplete()
Returns the percent complete that an indexing operation is if an indexing operation is currently active (i.e., isBusy() returns true). Valid percentages returned are from 0 to 100. If no indexing operation is active, this method will return -1.

Returns:
the percent complete that the currently active index operation is.

getTotalCount

int getTotalCount()
Returns the total number of entries that are to be indexed if an indexing operation is currently active (i.e., isBusy() returns true).

Returns:
the total number of entries that are to be indexed

getCurrentCount

int getCurrentCount()
Returns the number of entries that have been indexed if an indexing operation is currently active (i.e., isBusy() returns true).

Returns:
the number of entries that have been indexed

isWildcardIgnored

boolean isWildcardIgnored()
Returns true if wildcarding is disabled. When wildcarding is disabled, characters such as *, ?, and ~ are simply ignored.

Returns:
true if wildcards are ignored.

setWildcardIgnored

void setWildcardIgnored(boolean value)
Turns on or off wildcarding. When wildcarding is disabled, characters such as *, ?, and ~ are simply ignored.

Parameters:
value - true if wildcards are to be ignored. false enables wildcard search.

isAutoIndexEnabled

boolean isAutoIndexEnabled()
Returns true if auto indexing is turned on. When auto indexing is on, it will update the search index at the interval specified by the setUpdateInterval method.

Returns:
true if auto indexing is turned on.

setAutoIndexEnabled

void setAutoIndexEnabled(boolean value)
Enables or disables auto indexing. When auto indexing is on, it will update the search index at the interval specified by the setUpdateInterval method.

Parameters:
value - true to turn auto indexing on, false to turn it off.

getAutoIndexInterval

int getAutoIndexInterval()
Returns the number of minutes that the indexer waits between each update.

Returns:
the number of hours between automatic index updates.

setAutoIndexInterval

void setAutoIndexInterval(int minutes)
Sets the amount of time that indexer should wait between updating the index.

Parameters:
minutes - the number of minutes between automatic index updates.

getLastIndexedDate

java.util.Date getLastIndexedDate()
Returns the date that the last update to the index was made.

Returns:
the date the last index update was made.

addToIndex

void addToIndex(ForumMessage message)
Adds an individual message to the index. This method is useful for doing real-time indexing. However, for maximum posting speed this method can be ignored. In that case, the automatic indexer will pick up all new messages at the next index interval.

Parameters:
message - the message to add to the index.

removeFromIndex

void removeFromIndex(ForumMessage message)
Removes an individual message from the index.

Parameters:
message - the message to remove from the index.

removeFromIndex

void removeFromIndex(ForumThread thread)
Removes a thread from the index.

Parameters:
thread - the thread to remove from the index.

removeFromIndex

void removeFromIndex(Forum forum)
Removes a forum from the index.

Parameters:
forum - the forum to remove from the index.

updateIndex

void updateIndex()
Manually update the index to include all new messages since the last update.


rebuildIndex

void rebuildIndex()
Manually rebuild the entire index. This operation can be slow if the index is large.


optimize

void optimize()
Optimizes the underlying search index for maximum speed. This operation may be CPU intensive so should be performed relatively infrequently. Rebuilding an index should automatically optimize it.


isFilterHTMLEnabled

boolean isFilterHTMLEnabled()
Determines whether to filter out HTML when indexing and retrieving messages.

Returns:
true if HTML should be filtered.

setFilterHTMLEnabled

void setFilterHTMLEnabled(boolean filterHTMLEnabled)
Set whether or not to index and display HTML within messages.

Parameters:
filterHTMLEnabled - true if HTML should be filtered.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.