Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community
Interface SearchQueryManager

All Superinterfaces:
JiveManager

public interface SearchQueryManager
extends JiveManager

This manager provides methods to create query objects to be used for searching either the whole system or just in particular areas such as communities.

Example usage:

 JiveContext jiveContext = JiveApplication.getContext(authToken);
 SearchQueryManager manager = jiveContext.getSearchQueryManager();
 SearchQueryCriteria criteria = manager.createSearchQueryCriteria("Jive Rocks");
 // an example of specifying blog post criteria
 BlogPostSearchQueryCriteria blogCriteria = criteria.getBlogPostSearchCriteria();
 blogCriteria.setCommentsIncludedInSearch(true);
 // an example of specifying document criteria
 DocumentSearchQueryCriteria documentCriteria = criteria.getDocumentSearchCriteria();
 documentCriteria.setCommentsIncludedInSearch(true);
 // an example of specifying message criteria
 MessageSearchQueryCriteria messageCriteria = criteria.getMessageSearchCriteria();
 messageCriteria.setSingleResultPerThread(true); 

 SearchQuery query = manager.createSearchQuery(criteria);
 Iterable<SearchQueryResult> allResults = query.getResults();
 for (SearchQueryResult result: allResults) {
  // display result
 }
 


Method Summary
 SearchQuery createSearchQuery(SearchQueryCriteria criteria)
          Creates a SearchQuery object to search through all blogs, documents and messages system wide.
 SearchQuery createSearchQuery(SearchQueryCriteria criteria, Community... communities)
          Creates a SearchQuery object to search through the specified array of communities.
 SearchQueryCriteria createSearchQueryCriteria(Blog blog)
          Returns a SearchQueryCriteria that can be used to query for blogs that are deemed similar to the provided blog.
 SearchQueryCriteria createSearchQueryCriteria(BlogPost blogPost)
          Returns a SearchQueryCriteria that can be used to query for other items that are deemed similar to the provided blog post.
 SearchQueryCriteria createSearchQueryCriteria(Comment comment)
          Returns a SearchQueryCriteria that can be used to query for other searchable items that are deemed similar to the provided comment.
 SearchQueryCriteria createSearchQueryCriteria(Document document)
          Returns a SearchQueryCriteria that can be used to query for other items that are deemed similar to the provided document.
 SearchQueryCriteria createSearchQueryCriteria(ForumMessage message)
          Returns a SearchQueryCriteria that can be used to query for other searchable items that are deemed similar to the provided message.
 SearchQueryCriteria createSearchQueryCriteria(Project project)
          Returns a SearchQueryCriteria that can be used to query for projects that are deemed similar to the provided work space.
 SearchQueryCriteria createSearchQueryCriteria(SocialGroup group)
          Returns a SearchQueryCriteria that can be used to query for social groups that are deemed similar to the provided group.
 SearchQueryCriteria createSearchQueryCriteria(String queryString)
          Creates a SearchQueryCriteria using the provided query string that can be used to find other items matching the query string.
 SearchQueryCriteria createSearchQueryCriteria(com.jivesoftware.community.project.Task task)
          Returns a SearchQueryCriteria that can be used to query for other searchable items that are deemed similar to the provided task.
 org.apache.lucene.search.Filter getFilter(String key)
          Returns a cached filter assocaited with the related key.
 void logSearchClick(long searchID, int objectType, long objectID)
          Logs a search result clickthrough.
 org.apache.lucene.search.Filter putFilter(String key, org.apache.lucene.search.Filter filter)
          Adds a Filter to the Cache.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

Method Detail

createSearchQueryCriteria

SearchQueryCriteria createSearchQueryCriteria(String queryString)
Creates a SearchQueryCriteria using the provided query string that can be used to find other items matching the query string.

Parameters:
queryString - the query string to use for searching
Returns:
a SearchQueryCriteria object

createSearchQueryCriteria

SearchQueryCriteria createSearchQueryCriteria(Blog blog)
Returns a SearchQueryCriteria that can be used to query for blogs that are deemed similar to the provided blog.

Parameters:
blog - the blog to find similar blogs for
Returns:
a SearchQueryCriteria object

createSearchQueryCriteria

SearchQueryCriteria createSearchQueryCriteria(Project project)
Returns a SearchQueryCriteria that can be used to query for projects that are deemed similar to the provided work space.

Parameters:
project - to find similar work spaces for
Returns:
a SearchQueryCriteria object

createSearchQueryCriteria

SearchQueryCriteria createSearchQueryCriteria(SocialGroup group)
Returns a SearchQueryCriteria that can be used to query for social groups that are deemed similar to the provided group.

Parameters:
group - to find similar groups for
Returns:
a SearchQueryCriteria object

createSearchQueryCriteria

SearchQueryCriteria createSearchQueryCriteria(BlogPost blogPost)
Returns a SearchQueryCriteria that can be used to query for other items that are deemed similar to the provided blog post.

Parameters:
blogPost - the blog post to find similar content objects for
Returns:
a SearchQueryCriteria object

createSearchQueryCriteria

SearchQueryCriteria createSearchQueryCriteria(Document document)
Returns a SearchQueryCriteria that can be used to query for other items that are deemed similar to the provided document.

Parameters:
document - the document to find similar content objects for
Returns:
a SearchQueryCriteria object

createSearchQueryCriteria

SearchQueryCriteria createSearchQueryCriteria(ForumMessage message)
Returns a SearchQueryCriteria that can be used to query for other searchable items that are deemed similar to the provided message.

Parameters:
message - the message to find similar content objects for
Returns:
a SearchQueryCriteria object

createSearchQueryCriteria

SearchQueryCriteria createSearchQueryCriteria(Comment comment)
Returns a SearchQueryCriteria that can be used to query for other searchable items that are deemed similar to the provided comment.

Parameters:
comment - the comment to find similar content objects for
Returns:
a SearchQueryCriteria object

createSearchQueryCriteria

SearchQueryCriteria createSearchQueryCriteria(com.jivesoftware.community.project.Task task)
Returns a SearchQueryCriteria that can be used to query for other searchable items that are deemed similar to the provided task.

Parameters:
task - the task to find similar content objects for
Returns:
a SearchQueryCriteria object

createSearchQuery

SearchQuery createSearchQuery(SearchQueryCriteria criteria)
Creates a SearchQuery object to search through all blogs, documents and messages system wide. Note: only content objects that the user calling this method has read access for will be included in the search.

Parameters:
criteria - the search query criteria
Returns:
a SearchQuery object that can be used to search all visible and searchable communities.

createSearchQuery

SearchQuery createSearchQuery(SearchQueryCriteria criteria,
                              Community... communities)
Creates a SearchQuery object to search through the specified array of communities. Note: only the communities that the user calling this method has read access for will be included in the search.

Parameters:
criteria - the search query criteria
communities - the communities to search
Returns:
a SearchQuery object that can be used to search the specified communities.

getFilter

org.apache.lucene.search.Filter getFilter(String key)
Returns a cached filter assocaited with the related key. Null if no filter assocated with that key.

Parameters:
key - Filter to return
Returns:
Null if filter not cached, or cached filter object

putFilter

org.apache.lucene.search.Filter putFilter(String key,
                                          org.apache.lucene.search.Filter filter)
Adds a Filter to the Cache. If a filter with this key already exists, it will overwrite it with this filter.

Parameters:
key - key to associate with this filter
filter - Filter to be stored in the cache
Returns:
previous filter associated with specified key, or null if there was no mapping for key. A null return can also indicate that the map previously associated null with the specified key, if the implementation supports null values.

logSearchClick

void logSearchClick(long searchID,
                    int objectType,
                    long objectID)
Logs a search result clickthrough.

Parameters:
searchID - the searchID of the search associated with the clickthrough.
objectType - the object type of the search result that was clicked
objectID - the object ID of the search result that was clicked

Clearspace Project Page

Copyright © 1999-2007 Jive Software.