Clearspace API (1.7.0) Core Javadocs

com.jivesoftware.community
Class ProfileSearchQuery

java.lang.Object
  extended by com.jivesoftware.community.ProfileSearchQuery

public class ProfileSearchQuery
extends java.lang.Object

Contains the necessary information required to perform a user search.


Constructor Summary
ProfileSearchQuery(java.lang.String keywords)
          Creates a new query that does not contain any filters and searches all available user fields.
ProfileSearchQuery(java.lang.String keywords, java.util.List<ProfileSearchFilter> filters, boolean searchUsername, boolean searchName, boolean searchEmail, boolean searchProfile, boolean admin)
          Creates a new query, results sorted by relevance.
ProfileSearchQuery(java.lang.String keywords, java.util.List<ProfileSearchFilter> filters, org.apache.lucene.search.Sort sort, boolean searchUsername, boolean searchName, boolean searchEmail, boolean searchProfile, boolean admin, Community community)
          Creates a new query, results sorted by the given sort.
 
Method Summary
 Community getCommunity()
          Gets the community used for this query.
 java.util.List<ProfileSearchFilter> getFilters()
          Gets a list of ProfileSearchFilters used to filter user results for this query.
 java.lang.String getKeywords()
          Gets the keywords for the user search.
 org.apache.lucene.search.Sort getSort()
          Gets the sort used for this query.
 boolean isAdmin()
          Return True if the user performing the search is a system administrator, false otherwise.
 boolean isSearchEmail()
          Returns true if the user's email field is to be searched, false otherwise.
 boolean isSearchName()
          Returns true if the user's name field is to be searched, false otherwise.
 boolean isSearchProfile()
          Returns true if the user's profile field values are to be searched, false otherwise.
 boolean isSearchUsername()
          Returns true if the user's username field is to be searched, false otherwise.
 void setAdmin(boolean admin)
          True if the user performing the search is a system administrator, false otherwise.
 void setCommunity(Community community)
          Sets the community the user wants to find an expert in.
 void setFilters(java.util.List<ProfileSearchFilter> filters)
          Sets a list of ProfileSearchFilters used to filter user results for this query.
 void setKeywords(java.lang.String keywords)
          Sets the keywords for the user search.
 void setSearchEmail(boolean searchEmail)
          True if the user's email field is to be searched, false otherwise.
 void setSearchName(boolean searchName)
          True if the user's name field is to be searched, false otherwise.
 void setSearchProfile(boolean searchProfile)
          True if the user's profile field values are to be searched, false otherwise.
 void setSearchUsername(boolean searchUsername)
          True if the user's username field is to be searched, false otherwise.
 void setSort(org.apache.lucene.search.Sort sort)
          Sets the Sort used for this query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileSearchQuery

public ProfileSearchQuery(java.lang.String keywords)
Creates a new query that does not contain any filters and searches all available user fields.

Parameters:
keywords - the keywords to search

ProfileSearchQuery

public ProfileSearchQuery(java.lang.String keywords,
                          java.util.List<ProfileSearchFilter> filters,
                          boolean searchUsername,
                          boolean searchName,
                          boolean searchEmail,
                          boolean searchProfile,
                          boolean admin)
Creates a new query, results sorted by relevance.

Parameters:
keywords - the keywords to search
filters - a list of ProfileSearchFilters
searchUsername - true to search the user's username field, false otherwise.
searchName - true to search the user's name field, false otherwise. The user's name field will not be searchable if User.isNameVisible() is false.
searchEmail - true to search the user's email field, false otherwise. The user's email field will not be searchable if User.isEmailVisible() is false.
searchProfile - true to search the user's profile fields, false otherwise. A profile field will not be searchable if ProfileField.isVisible() is false.
admin - true to search the user's name and email fields, whether or not they are hidden. The default value for this field is false, and this field should only be set if the user performing the search is a system administrator.

ProfileSearchQuery

public ProfileSearchQuery(java.lang.String keywords,
                          java.util.List<ProfileSearchFilter> filters,
                          org.apache.lucene.search.Sort sort,
                          boolean searchUsername,
                          boolean searchName,
                          boolean searchEmail,
                          boolean searchProfile,
                          boolean admin,
                          Community community)
Creates a new query, results sorted by the given sort.

Parameters:
keywords - the keywords to search
filters - a list of ProfileSearchFilters
sort - a field to sort the results by
searchUsername - true to search the user's username field, false otherwise.
searchName - true to search the user's name field, false otherwise. The user's name field will not be searchable if User.isNameVisible() is false.
searchEmail - true to search the user's email field, false otherwise. The user's email field will not be searchable if User.isEmailVisible() is false.
searchProfile - true to search the user's profile fields, false otherwise. A profile field will not be searchable if ProfileField.isVisible() is false.
admin - true to search the user's name and email fields, whether or not they are hidden. The default value for this field is false, and this field should only be set if the user performing the search is a system administrator.
community - a specific community that the user wants to find experts in
Method Detail

getKeywords

public java.lang.String getKeywords()
Gets the keywords for the user search.

Returns:
the keywords for the user search.

setKeywords

public void setKeywords(java.lang.String keywords)
Sets the keywords for the user search.

Parameters:
keywords - the keywords for the user search

getFilters

public java.util.List<ProfileSearchFilter> getFilters()
Gets a list of ProfileSearchFilters used to filter user results for this query.

Returns:
a list of ProfileSearchFilters used to filter user results for this query.

setFilters

public void setFilters(java.util.List<ProfileSearchFilter> filters)
Sets a list of ProfileSearchFilters used to filter user results for this query.

Parameters:
filters - a list of ProfileSearchFilters used to filter user results for this query.

getSort

public org.apache.lucene.search.Sort getSort()
Gets the sort used for this query. Defaults to Sort.RELEVANCE.

Returns:
sorting strategy for this query.

setSort

public void setSort(org.apache.lucene.search.Sort sort)
Sets the Sort used for this query.

Parameters:
sort - sorting strategy for this query.

getCommunity

public Community getCommunity()
Gets the community used for this query. Null unless the user wants to find an expert in a specific community.

Returns:
the community the user wants to find an expert in.

setCommunity

public void setCommunity(Community community)
Sets the community the user wants to find an expert in.

Parameters:
community - the community the user wants to find an expert in.

isSearchUsername

public boolean isSearchUsername()
Returns true if the user's username field is to be searched, false otherwise.

Returns:
true if the user's username field is to be searched, false otherwise.

setSearchUsername

public void setSearchUsername(boolean searchUsername)
True if the user's username field is to be searched, false otherwise.

Parameters:
searchUsername - true if the user's username field is to be searched, false otherwise.

isSearchName

public boolean isSearchName()
Returns true if the user's name field is to be searched, false otherwise. Note: The user's name field will not be searchable regardless of this value if User.isNameVisible() is false.

Returns:
true if the user's name field is to be searched, false otherwise.

setSearchName

public void setSearchName(boolean searchName)
True if the user's name field is to be searched, false otherwise. Note: The user's name field will not be searchable regardless of this value if User.isNameVisible() is false.

Parameters:
searchName - true if the user's name field is to be searched, false otherwise.

isSearchEmail

public boolean isSearchEmail()
Returns true if the user's email field is to be searched, false otherwise. Note: The user's email field will not be searchable regardless of this value if User.isEmailVisible() is false.

Returns:
true if the user's email field is to be searched, false otherwise.

setSearchEmail

public void setSearchEmail(boolean searchEmail)
True if the user's email field is to be searched, false otherwise. Note: The user's email field will not be searchable regardless of this value if User.isEmailVisible() is false.

Parameters:
searchEmail - true if the user's email field is to be searched, false otherwise.

isSearchProfile

public boolean isSearchProfile()
Returns true if the user's profile field values are to be searched, false otherwise. Note: The user's profile field values will not be searchable regardless of this value if ProfileField.isVisible() is false.

Returns:
true if the user's profile field values are to be searched, false otherwise.

setSearchProfile

public void setSearchProfile(boolean searchProfile)
True if the user's profile field values are to be searched, false otherwise. Note: The user's profile field values will not be searchable regardless of this value if ProfileField.isVisible() is false.

Parameters:
searchProfile - true if the user's profile field values are to be searched, false otherwise.

isAdmin

public boolean isAdmin()
Return True if the user performing the search is a system administrator, false otherwise. Note: This field must be set to true to search hidden names and email addresses. This class does not validate that the user is in fact an admin, that responsibility is left to the caller of this class.

Returns:
true if the user performing the search is a system administrator, false otherwise.

setAdmin

public void setAdmin(boolean admin)
True if the user performing the search is a system administrator, false otherwise. Note: This field must be set to true to search hidden names and email addresses. This class does not validate that the user is in fact an admin, that responsibility is left to the caller of this class.

Parameters:
admin - true if the user performing the search is a system administrator, false otherwise.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.