Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community
Interface SearchManager

All Superinterfaces:
JiveManager

public interface SearchManager
extends JiveManager

Manages the search feature of Clearspace by defining properties of the search indexer. Indexing can either be done real-time by calling addToIndex(xxx) every time a new content object is created, or by running the indexer in timed update mode. The latter mode is preferable since it allows for faster content object 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 community. Frequent updates mean that content objects will be searchable more quickly. Less frequent updates use fewer system resources.

If you are not using the Jive 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:


Method Summary
 void addTextExtractor(String className)
          Installs a new class into the list of available text extractors for the system.
 void addToIndex(Attachment attachment)
          Adds an individual attachment to the index.
 void addToIndex(Blog blog)
          Adds an individual blog to the index.
 void addToIndex(BlogPost blogPost)
          Adds an individual blog posts to the index.
 void addToIndex(Comment comment)
          Adds an individual comment to the index.
 void addToIndex(Community community)
          Adds an individual community to the index.
 void addToIndex(Document document)
          Adds an individual document to the index.
 void addToIndex(ForumMessage message)
          Adds an individual message to the index.
 void addToIndex(Project project)
          Adds an individual project to the index.
 void addToIndex(SocialGroup socialGroup)
          Adds an individual socialGroup to the index.
 void addToIndex(com.jivesoftware.community.project.Task task)
          Adds an individual task to the index.
 int getAutoIndexInterval()
          Returns the number of minutes that the indexer waits between each update.
 int getCurrentCount()
          Returns the number of content objects that have been indexed if an indexing operation is currently active (i.e., isBusy() returns true).
 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).
 Collection<com.jivesoftware.community.search.TextExtractor> getTextExtractors()
          Returns the current collection of TextExtractor objects.
 int getTotalCount()
          Returns the total number of content objects 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 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(Attachment attachment)
          Removes an individual attachment from the index.
 void removeFromIndex(Blog blog)
          Removes a blog from the index.
 void removeFromIndex(BlogPost blogPost)
          Removes an individual blog post from the index.
 void removeFromIndex(Comment comment)
          Removes an individual comment from the index.
 void removeFromIndex(Community community)
          Removes a community from the index.
 void removeFromIndex(Document document)
          Removes an individual document from the index.
 void removeFromIndex(DocumentType type)
          Removes all documents of a given document type 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 removeFromIndex(Project project)
          Removes a project from the index.
 void removeFromIndex(SocialGroup socialGroup)
          Removes a social group from the index.
 void removeFromIndex(com.jivesoftware.community.project.Task task)
          Removes a task from the index.
 void removeTextExtractor(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 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 and updated content objects since the last update.
 void updateIndex(Attachment attachment)
          Updates an individual attachment in the index.
 void updateIndex(Blog blog)
          Update an individual blog in the index.
 void updateIndex(BlogPost blogPost)
          Update an individual blog post in the index.
 void updateIndex(Comment comment)
          Updates an individual comment in the index.
 void updateIndex(Community community)
          Update an individual community in the index.
 void updateIndex(Document document)
          Update an individual document in the index.
 void updateIndex(ForumMessage message)
          Update an individual message in the index.
 void updateIndex(Project project)
          Update an individual project in the index.
 void updateIndex(SocialGroup socialGroup)
          Update an individual social group in the index.
 void updateIndex(com.jivesoftware.community.project.Task task)
          Update an individual task in the index.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

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 to enable attachment searching, false to disable.

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, false to disable.

isWildcardIgnored

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

Returns:
true if wildcards are ignored, false if wildcards are allowed.

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.

getTextExtractors

Collection<com.jivesoftware.community.search.TextExtractor> getTextExtractors()
Returns the current collection of TextExtractor objects.

Returns:
a collection of text extractors.

addTextExtractor

void addTextExtractor(String className)
                      throws 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:
ClassNotFoundException - if the class could not be loaded.
IllegalArgumentException - if the classname is not a TextExtractor or cannot be loaded.

removeTextExtractor

void removeTextExtractor(String className)
                         throws 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:
ClassNotFoundException - if the class could not be loaded.
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 content objects that are to be indexed if an indexing operation is currently active (i.e., isBusy() returns true).

Returns:
the total number of content objects that are to be indexed

getCurrentCount

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

Returns:
the number of content objects that have been indexed

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

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

Returns:
the date the last index update was made.

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 will automatically optimize it.


updateIndex

void updateIndex()
Manually update the index to include all new and updated content objects since the last update.


rebuildIndex

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


addToIndex

void addToIndex(Blog blog)
Adds an individual blog 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 blogs at the next index interval.

Note that this method will only add the blog to the index - it will not add any child posts to the index

Parameters:
blog - the blog to add to the index

addToIndex

void addToIndex(BlogPost blogPost)
Adds an individual blog posts 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 blog posts at the next index interval.

Parameters:
blogPost - the blog post to add to the index.

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.

addToIndex

void addToIndex(Document document)
Adds an individual document 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 documents at the next index interval.

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

addToIndex

void addToIndex(Comment comment)
Adds an individual comment 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 comments at the next index interval.

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

addToIndex

void addToIndex(Attachment attachment)
Adds an individual attachment 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 attachment at the next index interval.

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

addToIndex

void addToIndex(Community community)
Adds an individual community 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 blog posts at the next index interval.

Note that this method will only add the community to the index - it will not add any child objects to the index

Parameters:
community - the community to add to the index

addToIndex

void addToIndex(Project project)
Adds an individual project 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 projects at the next index interval.

Note that this method will only add the project to the index - it will not add any child objects to the index

Parameters:
project - the project to add to the index

addToIndex

void addToIndex(SocialGroup socialGroup)
Adds an individual socialGroup 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 social groups at the next index interval.

Note that this method will only add the social group to the index - it will not add any child objects to the index

Parameters:
socialGroup - the socialGroup to add to the index

addToIndex

void addToIndex(com.jivesoftware.community.project.Task task)
Adds an individual task 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 tasks at the next index interval.

Parameters:
task - the task to add to the index

updateIndex

void updateIndex(Blog blog)
Update an individual blog in the index. This method is useful for doing real-time updates. However, for maximum posting speed this method can be ignored. In that case, the automatic indexer will pick up all updated blogs at the next index interval.

Note that this method will only update the blog to the index - it will not update any child objects to the index

Parameters:
blog - the blog to update in the index.

updateIndex

void updateIndex(BlogPost blogPost)
Update an individual blog post in the index. This method is useful for doing real-time updates. However, for maximum posting speed this method can be ignored. In that case, the automatic indexer will pick up all updated blog posts at the next index interval.

Parameters:
blogPost - the blog post to update in the index.

updateIndex

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

Parameters:
message - the message to update in the index.

updateIndex

void updateIndex(Document document)
Update an individual document in the index. This method is useful for doing real-time updates. However, for maximum posting speed this method can be ignored. In that case, the automatic indexer will pick up all updated documents at the next index interval.

Parameters:
document - the document to update in the index.

updateIndex

void updateIndex(Comment comment)
Updates an individual comment in the index. This method is useful for doing real-time updates. However, for maximum posting speed this method can be ignored. In that case, the automatic indexer will pick up all updated comments at the next index interval.

Parameters:
comment - the comment to update in the index.

updateIndex

void updateIndex(Attachment attachment)
Updates an individual attachment in 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 updated attachments at the next index interval.

Parameters:
attachment - the attachment to update in the index.

updateIndex

void updateIndex(Community community)
Update an individual community in the index. This method is useful for doing real-time updates. However, for maximum posting speed this method can be ignored. In that case, the automatic indexer will pick up all updated communities at the next index interval.

Note that this method will only update the community to the index - it will not update any child objects to the index

Parameters:
community - the community to update in the index.

updateIndex

void updateIndex(Project project)
Update an individual project in the index. This method is useful for doing real-time updates. However, for maximum posting speed this method can be ignored. In that case, the automatic indexer will pick up all updated projects at the next index interval.

Note that this method will only update the project to the index - it will not update any child objects to the index

Parameters:
project - the project to update in the index.

updateIndex

void updateIndex(SocialGroup socialGroup)
Update an individual social group in the index. This method is useful for doing real-time updates. However, for maximum posting speed this method can be ignored. In that case, the automatic indexer will pick up all updated social group at the next index interval.

Note that this method will only update the social group to the index - it will not update any child objects to the index

Parameters:
socialGroup - the social group to update in the index.

updateIndex

void updateIndex(com.jivesoftware.community.project.Task task)
Update an individual task in the index. This method is useful for doing real-time updates. However, for maximum posting speed this method can be ignored. In that case, the automatic indexer will pick up all updated tasks at the next index interval.

Parameters:
task - the task to update in the index.

removeFromIndex

void removeFromIndex(Blog blog)
Removes a blog from the index.

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

removeFromIndex

void removeFromIndex(BlogPost blogPost)
Removes an individual blog post from the index.

Parameters:
blogPost - the blogPost to remove from 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(Document document)
Removes an individual document from the index.

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

removeFromIndex

void removeFromIndex(Comment comment)
Removes an individual comment from the index.

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

removeFromIndex

void removeFromIndex(Attachment attachment)
Removes an individual attachment from the index.

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

removeFromIndex

void removeFromIndex(Community community)
Removes a community from the index.

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

removeFromIndex

void removeFromIndex(Project project)
Removes a project from the index.

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

removeFromIndex

void removeFromIndex(SocialGroup socialGroup)
Removes a social group from the index.

Parameters:
socialGroup - the social group to remove from the index.

removeFromIndex

void removeFromIndex(com.jivesoftware.community.project.Task task)
Removes a task from the index.

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

removeFromIndex

void removeFromIndex(DocumentType type)
Removes all documents of a given document type from the index.

Parameters:
type - the document type to remove from the index.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.