|
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.profiles.search.ProfileSearchManagerImpl
public class ProfileSearchManagerImpl
Database implementation of ProfileSearchManager using the Lucene search package. Search indexes are stored in the "search/user" subdirectory of jiveHome.
| Field Summary | |
|---|---|
protected static org.apache.lucene.analysis.Analyzer |
indexerAnalyzer
The analyzer governs how words are tokenized. |
protected static org.apache.lucene.analysis.Analyzer |
searcherAnalyzer
The analyzer governs how words are tokenized. |
protected static ReadWriteLock |
searcherLock
|
| Method Summary | |
|---|---|
void |
addToIndex(User user)
Adds an individual user to the index. |
void |
addToIndex(User user,
boolean cluster)
|
protected void |
addUserToIndex(long userID,
org.apache.lucene.index.IndexWriter writer)
Indexes an individual user. |
static void |
closeSearcherReader()
Closes the readers used by the searcher to indicate that a change to the index was made. |
protected void |
deleteUsersFromIndex(long[] entries,
org.apache.lucene.index.IndexReader reader)
Deletes users(s) from the index. |
void |
destroy()
Notifies the manager to release any resources that may be holding on too. |
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., ProfileSearchManager.isBusy() returns true). |
static ProfileSearchManagerImpl |
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., ProfileSearchManager.isBusy() returns true). |
static XMLJiveProperties |
getProperties()
|
int |
getTotalCount()
Returns the total number of entries that are to be indexed if an indexing operation is currently active (i.e., ProfileSearchManager.isBusy() returns true). |
void |
initialize()
Initialize the manager. |
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. |
protected void |
removeFromIndex(long userID)
|
void |
removeFromIndex(User user)
Removes an individual user from the index. |
void |
removeFromIndex(User user,
boolean cluster)
|
org.apache.lucene.search.Hits |
search(ProfileSearchQuery query)
Returns the hits that correspond to the search query. |
void |
setAutoIndexEnabled(boolean enabled)
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 |
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. |
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 |
|---|
protected static ReadWriteLock searcherLock
protected static org.apache.lucene.analysis.Analyzer indexerAnalyzer
protected static org.apache.lucene.analysis.Analyzer searcherAnalyzer
| Method Detail |
|---|
public static ProfileSearchManagerImpl getInstance()
public boolean isSearchEnabled()
ProfileSearchManager
isSearchEnabled in interface ProfileSearchManagerpublic void setSearchEnabled(boolean searchEnabled)
ProfileSearchManager
setSearchEnabled in interface ProfileSearchManagersearchEnabled - true to enable the search feature, false to disable.public boolean isEmailVisible()
ProfileSearchManager
isEmailVisible in interface ProfileSearchManagerpublic void setEmailVisible(boolean emailVisible)
ProfileSearchManager
setEmailVisible in interface ProfileSearchManageremailVisible - true if user email addresses are visible, false otherwise.public org.apache.lucene.search.Hits search(ProfileSearchQuery query)
ProfileSearchManager
search in interface ProfileSearchManagerquery - the profile search query
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 int getAutoIndexInterval()
ProfileSearchManager
getAutoIndexInterval in interface ProfileSearchManagerpublic void setAutoIndexInterval(int minutes)
ProfileSearchManager
setAutoIndexInterval in interface ProfileSearchManagerminutes - the number of minutes between automatic index updates.public java.util.Date getLastIndexedDate()
ProfileSearchManager
getLastIndexedDate in interface ProfileSearchManagerpublic boolean isBusy()
ProfileSearchManagerProfileSearchManager.rebuildIndex() will do nothing. If you'd like to
query the status of the indexing operation while the manager is busy, use the
ProfileSearchManager.getPercentComplete() method.
isBusy in interface ProfileSearchManagerpublic int getPercentComplete()
ProfileSearchManagerProfileSearchManager.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 ProfileSearchManagerpublic int getTotalCount()
ProfileSearchManagerProfileSearchManager.isBusy() returns true).
getTotalCount in interface ProfileSearchManagerpublic int getCurrentCount()
ProfileSearchManagerProfileSearchManager.isBusy() returns true).
getCurrentCount in interface ProfileSearchManagerpublic boolean isAutoIndexEnabled()
ProfileSearchManager
isAutoIndexEnabled in interface ProfileSearchManagerpublic void setAutoIndexEnabled(boolean enabled)
ProfileSearchManager
setAutoIndexEnabled in interface ProfileSearchManagerenabled - true to turn auto indexing on, false to turn it off.public void addToIndex(User user)
ProfileSearchManager
addToIndex in interface ProfileSearchManageruser - the user to add to the index.
public void addToIndex(User user,
boolean cluster)
public void removeFromIndex(User user)
ProfileSearchManager
removeFromIndex in interface ProfileSearchManageruser - the user to remove from the index.
public void removeFromIndex(User user,
boolean cluster)
protected void removeFromIndex(long userID)
public void updateIndex()
ProfileSearchManager
updateIndex in interface ProfileSearchManagerpublic void rebuildIndex()
ProfileSearchManager
rebuildIndex in interface ProfileSearchManagerpublic void optimize()
ProfileSearchManager
optimize in interface ProfileSearchManager
protected final void updateIndex(java.util.Date start,
java.util.Date end)
protected final void addUserToIndex(long userID,
org.apache.lucene.index.IndexWriter writer)
protected final void deleteUsersFromIndex(long[] entries,
org.apache.lucene.index.IndexReader reader)
throws java.io.IOException
java.io.IOExceptionpublic static void closeSearcherReader()
|
Jive Forums Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||