Jive API (3.0.13) 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.
 SearchQueryCriteria createSearchQueryCriteria(JiveObject jiveObject)
          Returns a SearchQueryCriteria that can be used to query for jiveObjects that are deemed similar to the provided blog.
 SearchQueryCriteria createSearchQueryCriteria(String queryString)
          Creates a SearchQueryCriteria using the provided query string that can be used to find other items matching the query string.
 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(JiveObject jiveObject)
Returns a SearchQueryCriteria that can be used to query for jiveObjects that are deemed similar to the provided blog.

Parameters:
jiveObject - the jiveObject to find similar results 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.

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

Jive Product Page

Copyright © 1999-2007 Jive Software.