Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community.user.profile
Interface ProfileSearchManager

All Superinterfaces:
JiveManager

public interface ProfileSearchManager
extends JiveManager

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

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

If you are not using the Jive Expert User 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 profile search manager settings:


Nested Class Summary
static class ProfileSearchManager.SortType
           
 
Method Summary
 void addToIndex(User user)
          Adds an individual user 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).
 String getEveryoneQuery()
          Return a Lucene query string to find all users in the system.
 Date getLastIndexedDate()
          Returns the date that the last update to the index was made.
 ProfileSearchResults getNewestMembers(int limit)
          Get results corresponding to the recent members in the system.
 int getPercentComplete()
          Returns the percent complete that an indexing operation is if an indexing operation is currently active (i.e., isBusy() returns true).
 Set<String> getPrefixCharacters()
          Returns a set of one-character Strings corresponding to the first character (or symbol) of all usernames, names, first names, and last names in the system.
 ProfileSearchResults getSimilarUserResults(long userID, int limit)
          Returns the hits that are similar to the specified user.
 org.apache.lucene.search.Sort getSort(ProfileSearchManager.SortType sortType)
          Return a Lucene Sort object for the specified field
 org.apache.lucene.search.Sort getSort(ProfileSearchManager.SortType sortType, Locale locale)
          Return a Lucene Sort object for the specified field and locale.
 ProfileSearchResults getTopMembers(int limit)
          Get results corresponding to the top members in the system.
 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 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 isEmailVisible()
          Determines whether or not user email addresses are visible when performing a user search.
 boolean isSearchEnabled()
          Returns true if the profile search feature is turned on.
 void optimize()
          Optimizes the underlying search index for maximum speed.
 void rebuildIndex()
          Manually rebuild the entire index.
 void removeFromIndex(User user)
          Removes an individual user from the index.
 ProfileSearchResults search(ProfileSearchQuery query)
          Returns a ProfileSearchResults that corresponds to the search query.
 void setAddDefaultPrefixCharacters(boolean addDefaultPrefix)
          If true, we will always populate the prefix set with "a" through "z", in addition to automatically.
 void setAutoIndexEnabled(boolean value)
          Enables or disables auto indexing.
 void setAutoIndexInterval(int minutes)
          Sets the number of minutes that indexer should wait between updating the index.
 void setEmailVisible(boolean emailVisible)
          Determines whether or not user email addresses are visible when performing a user search.
 void setFilterSymbolPrefixCharacters(boolean filterSymbolsOnPrefixCharacters)
          If true, will remove "symbol" chars from automatcally generated prefix character list, i.e. any character that doesn't match the \p{L} regex.
 void setSearchEnabled(boolean searchEnabled)
          Enables or disables the profile search feature.
 void updateIndex()
          Manually update the index to include all new objects since the last update.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

Method Detail

isSearchEnabled

boolean isSearchEnabled()
Returns true if the profile search feature is turned on. When profile 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)
                      throws UnauthorizedException
Enables or disables the profile search feature. When profile 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.
Throws:
UnauthorizedException - if not the system admin.

isEmailVisible

boolean isEmailVisible()
Determines whether or not user email addresses are visible when performing a user search. If emailVisible is set to false, email addresses will not be displayed on the user search results page, regardless of the user's personal emailVisible setting. If emailVisible is true then email addresses will be displayed only for user's with their personal emailVisible setting equal to true. EmailVisible is true by default.


setEmailVisible

void setEmailVisible(boolean emailVisible)
                     throws UnauthorizedException
Determines whether or not user email addresses are visible when performing a user search. If emailVisible is set to false, email addresses will not be displayed on the user search results page, regardless of the user's personal emailVisible setting. If emailVisible is true then email addresses will be displayed only for user's with their personal emailVisible setting equal to true. EmailVisible is true by default.

Parameters:
emailVisible - true if user email addresses are visible, false otherwise.
Throws:
UnauthorizedException - if not the system admin.

setAddDefaultPrefixCharacters

void setAddDefaultPrefixCharacters(boolean addDefaultPrefix)
                                   throws UnauthorizedException
If true, we will always populate the prefix set with "a" through "z", in addition to automatically.

Throws:
UnauthorizedException - if not the system admin.

setFilterSymbolPrefixCharacters

void setFilterSymbolPrefixCharacters(boolean filterSymbolsOnPrefixCharacters)
                                     throws UnauthorizedException
If true, will remove "symbol" chars from automatcally generated prefix character list, i.e. any character that doesn't match the \p{L} regex.

Parameters:
filterSymbolsOnPrefixCharacters -
Throws:
UnauthorizedException - if not the system admin.

search

ProfileSearchResults search(ProfileSearchQuery query)
Returns a ProfileSearchResults that corresponds to the search query.

Parameters:
query - the profile search query
Returns:
a results object containing users that match the search criteria.

getSimilarUserResults

ProfileSearchResults getSimilarUserResults(long userID,
                                           int limit)
Returns the hits that are similar to the specified user. This method only checks profile data, and does not use username, name, or email address as a means of determining similarity.

Parameters:
userID - the userID that other user records will be similar to
limit - The limit of results returned.
Returns:
the users that are similar to the specified userID

getTopMembers

ProfileSearchResults getTopMembers(int limit)
Get results corresponding to the top members in the system.

Parameters:
limit -
Returns:

getNewestMembers

ProfileSearchResults getNewestMembers(int limit)
Get results corresponding to the recent members in the system.

Parameters:
limit -
Returns:

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

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)
                         throws UnauthorizedException
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.
Throws:
UnauthorizedException - if not the system admin.

getAutoIndexInterval

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

Returns:
the number of minutes between automatic index updates.

setAutoIndexInterval

void setAutoIndexInterval(int minutes)
                          throws UnauthorizedException
Sets the number of minutes that indexer should wait between updating the index.

Parameters:
minutes - the number of minutes between automatic index updates.
Throws:
UnauthorizedException - if not the system admin.

getLastIndexedDate

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(User user)
Adds an individual user 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 entries at the next index interval.

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

removeFromIndex

void removeFromIndex(User user)
Removes an individual user from the index.

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

updateIndex

void updateIndex()
                 throws UnauthorizedException
Manually update the index to include all new objects since the last update.

Throws:
UnauthorizedException - if not the system admin.

rebuildIndex

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

Throws:
UnauthorizedException - if not the system admin.

optimize

void optimize()
              throws UnauthorizedException
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.

Throws:
UnauthorizedException - if not the system admin.

getPrefixCharacters

Set<String> getPrefixCharacters()
Returns a set of one-character Strings corresponding to the first character (or symbol) of all usernames, names, first names, and last names in the system.

Returns:
a set of one-charater strings.

getEveryoneQuery

String getEveryoneQuery()
Return a Lucene query string to find all users in the system.

Returns:
a Lucene query string to find all users in the system.

getSort

org.apache.lucene.search.Sort getSort(ProfileSearchManager.SortType sortType)
Return a Lucene Sort object for the specified field

Parameters:
sortType - the field by which to sort the results
Returns:
a Lucene Sort object that defined how to sort the results

getSort

org.apache.lucene.search.Sort getSort(ProfileSearchManager.SortType sortType,
                                      Locale locale)
Return a Lucene Sort object for the specified field and locale. The locale will be ignored for non-text fields where locale is irrelevant, e.g. creation date

Parameters:
sortType - the field by which to sort the results
locale - locale which defines the collator to use for sorting text
Returns:

Clearspace Project Page

Copyright © 1999-2007 Jive Software.