Removing your data from the content repository

Depending on your application life cycle, you might need to remove all of your application data from the Unified Search Service content repository. For example, a BlackBerry® device user may have multiple accounts for your application. It may make sense for the application data to appear in search results only if the user is currently authenticated by your application. Alternatively, your application may need to respond to locale changes. In this case, you should remove data from the content repository, then repopulate it with the data that is appropriate to the current locale.

The following table describes two approaches to remove all of your application data from the Unified Search Service content repository.

Approach

Description

Deregister an EntityBasedSearchable object.

This approach removes your EntityBasedSearchable object, and all data associated with it, from the Unified Search Service content index. Your EntityBasedSearchable no longer appears in the list of registered searchable data sources on the BlackBerry device.

To deregister an EntityBasedSearchable, invoke SearchRegistry.deregister(), and pass the registration token returned when that EntityBasedSearchable was registered.

Remove all data from the content repository for an EntityBasedSearchable object.

This approach removes all of your application data from the repository. You can use this approach when you need to remove all data, but you expect that you will continue to populate the repository with new data in the near future.

To remove all data from the content repository for an EntityBasedSearchable, invoke UnifiedSearchServices.removeAllData() and pass the registration token that was returned when that EntityBasedSearchable was registered.


Was this information helpful? Send us your comments.