Clearspace API (1.7.0) 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 blog posts, documents and messages that are deemed similar to the provided blog post.
 SearchQueryCriteria createSearchQueryCriteria(Document document)
          Returns a SearchQueryCriteria that can be used to query for blog posts, documents and messages that are deemed similar to the provided document.
 SearchQueryCriteria createSearchQueryCriteria(ForumMessage message)
          Returns a SearchQueryCriteria that can be used to query for blog posts, documents and messages that are deemed similar to the provided message.
 SearchQueryCriteria createSearchQueryCriteria(java.lang.String queryString)
          Creates a SearchQueryCriteria using the provided query string that can be used to find blog posts, documents and messages matching the query string.
 void logSearchClick(long searchID, int objectType, long objectID)
          Logs a search result clickthrough.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy, initialize
 

Method Detail

createSearchQueryCriteria

SearchQueryCriteria createSearchQueryCriteria(java.lang.String queryString)
Creates a SearchQueryCriteria using the provided query string that can be used to find blog posts, documents and messages 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(BlogPost blogPost)
Returns a SearchQueryCriteria that can be used to query for blog posts, documents and messages 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 blog posts, documents and messages 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 blog posts, documents and messages that are deemed similar to the provided message.

Parameters:
message - the message 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.

logSearchClick

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

Note: This method is a noop in the Lite and Professional editions

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.