net.rim.device.api.unifiedsearch
Class UnifiedSearchServices

java.lang.Object
  extended by net.rim.device.api.unifiedsearch.UnifiedSearchServices

public abstract class UnifiedSearchServices
extends Object

Provides services for an application to initiate a search in the Unified Search Framework.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

Method Summary
Category: Signed abstract  Vector getDeviceSearchables(long contentType)
          Returns a list of local (on-device) Searchable data sources for the content type specified.
Category: Signed static UnifiedSearchServices getInstance()
          Returns an instance of UnifiedSearchServices.
Category: Signed abstract  Vector getSearchProviders(long contentType)
          Returns a set of external (off-device) ExternalSearchProvider objects for the content type specified and SearchableContentTypeConstants.CONTENT_TYPE_WEB_DEFAULT.
Category: Signed abstract  boolean isIndexingCompleted()
          Indicates whether or not all registered data sources have been indexed.
Category: Signed abstract  void removeAllData(RegistrationToken token)
          Removes all SearchableEntity objects associated with a data source.
Category: Signed abstract  SearchResponse search(String keywords)
          Performs a blocking search on all available Searchable sources.
Category: Signed abstract  SearchResponse search(String keywords, Searchable searchable)
          Performs a blocking search on the Searchable source specified.
Category: Signed abstract  SearchResponse search(String keywords, Searchable[] searchables)
          Performs a blocking search on the Searchable sources specified.
Category: Signed abstract  SearchResponse search(String keywords, Searchable[] searchables, SearchField[][] fields)
          Performs a blocking search on the Searchable sources specified, using the SearchField objects specified.
Category: Signed abstract  SearchResponse search(String[] phrases)
          Performs a blocking search on all available Searchable sources.
Category: Signed abstract  SearchResponse search(String[] phrases, Searchable searchable)
          Performs a blocking search on the Searchable source specified.
Category: Signed abstract  SearchResponse search(String[] phrases, Searchable[] searchables)
          Performs a blocking search on the Searchable sources specified.
Category: Signed abstract  SearchResponse search(String[] phrases, Searchable[] searchables, SearchField[][] fields)
          Performs a blocking search on the Searchable sources specified, using the SearchField objects specified.
Category: Signed abstract  void setDataSourceComparator(RegistrationToken token, Comparator cmp)
          Sets a Comparator to be used when sorting data items in the data source associated with the RegistrationToken.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

getInstance

public static final UnifiedSearchServices getInstance()
Returns an instance of UnifiedSearchServices.

Returns:
A UnifiedSearchServices instance.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

getDeviceSearchables

public abstract Vector getDeviceSearchables(long contentType)
Returns a list of local (on-device) Searchable data sources for the content type specified.

Parameters:
contentType - The content type is a mask of SearchableContentTypeConstants.
Returns:
A Vector of Searchable objects.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

getSearchProviders

public abstract Vector getSearchProviders(long contentType)
Returns a set of external (off-device) ExternalSearchProvider objects for the content type specified and SearchableContentTypeConstants.CONTENT_TYPE_WEB_DEFAULT.

Parameters:
contentType - See SearchableContentTypeConstants.
Returns:
A Vector of ExternalSearchProvider objects.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

isIndexingCompleted

public abstract boolean isIndexingCompleted()
Indicates whether or not all registered data sources have been indexed.

Returns:
true, if indexing of data sources is complete; otherwise, false.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

search

public abstract SearchResponse search(String keywords,
                                      Searchable[] searchables,
                                      SearchField[][] fields)
                               throws Exception
Performs a blocking search on the Searchable sources specified, using the SearchField objects specified.

Parameters:
keywords - The search keywords. Individual keywords are combined using a logical AND operation.
searchables - An array of Searchable objects, or null if the search should inspect all available Searchable sources. Retrieve Searchable data sources by calling getDeviceSearchables.
fields - A two-dimensional array that specifies what fields to search in each Searchable data source. The first dimension should correspond to elements in the searchables array that have the the desired search fields. Use null if you want to search all fields.
Returns:
The response from the Unified Search Framework.
Throws:
Exception - If any error occurs during a search. For example, an exception would be thrown if a given SearchField is not found in the Searchableto which the search request assigned it.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

search

public abstract SearchResponse search(String keywords,
                                      Searchable[] searchables)
                               throws Exception
Performs a blocking search on the Searchable sources specified.

Parameters:
keywords - The search keywords. Individual keywords are combined using a logical AND operation.
searchables - An array of Searchable objects, or null if the search should inspect all available Searchable sources. Retrieve Searchable data sources by calling getDeviceSearchables.
Returns:
The response from the Unified Search Framework.
Throws:
Exception - If any error occurs during a search.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

search

public abstract SearchResponse search(String keywords,
                                      Searchable searchable)
                               throws Exception
Performs a blocking search on the Searchable source specified.

Parameters:
keywords - The search keywords. Individual keywords are combined using a logical AND operation.
searchable - A Searchable object, or null if the search should inspect all available Searchable sources. Retrieve Searchable data sources by calling getDeviceSearchables.
Returns:
The response from the Unified Search Framework.
Throws:
Exception - If any error occurs during a search.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

search

public abstract SearchResponse search(String keywords)
                               throws Exception
Performs a blocking search on all available Searchable sources.

Parameters:
keywords - The search keywords. Individual keywords are combined using a logical AND operation.
Returns:
The response from the Unified Search Framework.
Throws:
Exception - If any error occurs during a search.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

search

public abstract SearchResponse search(String[] phrases,
                                      Searchable[] searchables,
                                      SearchField[][] fields)
                               throws Exception
Performs a blocking search on the Searchable sources specified, using the SearchField objects specified.

Parameters:
phrases - The search keyword phrases. Individual keywords in each phrase are combined using a logical AND operation; results for entire phrases are combined using a logical OR operation.
searchables - An array of Searchable objects, or null if the search should inspect all available Searchable sources. Retrieve Searchable data sources by calling getDeviceSearchables.
fields - A two-dimensional array that specifies what fields to search in each Searchable data source. The first dimension should correspond to elements in the searchables array that have the the desired search fields. Use null if you want to search all fields.
Returns:
The response from the Unified Search Framework.
Throws:
Exception - If any error occurs during a search. For example, an exception would be thrown if a given SearchField is not found in the Searchableto which the search request assigned it.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

search

public abstract SearchResponse search(String[] phrases,
                                      Searchable[] searchables)
                               throws Exception
Performs a blocking search on the Searchable sources specified.

Parameters:
phrases - The search keyword phrases. Individual keywords in each phrase are combined using a logical AND operation; results for entire phrases are combined using a logical OR operation.
searchables - An array of Searchable objects, or null if the search should inspect all available Searchable sources. Retrieve Searchable data sources by calling getDeviceSearchables.
Returns:
The response from the Unified Search Framework.
Throws:
Exception - If any error occurs during a search.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

search

public abstract SearchResponse search(String[] phrases,
                                      Searchable searchable)
                               throws Exception
Performs a blocking search on the Searchable source specified.

Parameters:
phrases - The search keyword phrases. Individual keywords in each phrase are combined using a logical AND operation; results for entire phrases are combined using a logical OR operation.
searchable - A Searchable object, or null if the search should inspect all available Searchable sources. Retrieve Searchable data sources by calling getDeviceSearchables.
Returns:
The response from the Unified Search Framework.
Throws:
Exception - If any error occurs during a search.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

search

public abstract SearchResponse search(String[] phrases)
                               throws Exception
Performs a blocking search on all available Searchable sources.

Parameters:
phrases - The search keyword phrases. Individual keywords in each phrase are combined using a logical AND operation; results for entire phrases are combined using a logical OR operation.
Returns:
The response from the Unified Search Framework.
Throws:
Exception - If any error occurs during a search.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

removeAllData

public abstract void removeAllData(RegistrationToken token)
                            throws IllegalArgumentException
Removes all SearchableEntity objects associated with a data source. This is useful when the data source wishes to drop all entries from the database. It is also significantly faster than performing individual item by item delete operations.

Parameters:
token - the RegistrationToken acquired for the Searchable data source during registration.
Throws:
IllegalArgumentException - if an invalid RegistrationToken is provided
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

setDataSourceComparator

public abstract void setDataSourceComparator(RegistrationToken token,
                                             Comparator cmp)
                                      throws IllegalArgumentException
Sets a Comparator to be used when sorting data items in the data source associated with the RegistrationToken. Also note that setting the comparator causes a re-sort of the indexed data, so it is not advised to use this method often.

Parameters:
token - the RegistrationToken acquired for the Searchable data source during registration.
cmp - the Comparator to be applied to the data source. A null parameter is valid.
Throws:
IllegalArgumentException - if an invalid RegistrationToken or Comparator is provided
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal