Encapsulate your data in the SearchableEntity class

The Unified Search Service indexes the metadata that is exposed by a
SearchableEntity object. The Service also returns a
SearchableEntity as the content of a search result.
You must prepare your application data for the Service by encapsulating it in
your
SearchableEntity class.

Create a
SearchFieldCriteria object for each of your
searchable properties. In the following code sample, the application data
object
myObject has a
getProperty() method that returns a string for a
given index. For example, if
myObject described a book, then indicies 0, 1, and 2
of
getProperty() could return the name, the publisher,
and the number of pages in the book.

In
getData(), return your application data object. To
continue with the book example, this method would return an object that
represents the book.

public Object getData() {
return myObject;
}

In
getTitle(), assign a title to this searchable
entity. The title text appears in search results. To continue with the book
example,
myObject.getName() could return the name of a book.

public String getTitle() {
return myObject.getName();
}

In
getSummary() provide a summary of the data in this
searchable entity. The summary text appears in search results. Continuing with
the book example,
myObject.getDescription() could return a description
of the book.

public String getSummary() {
return myObject.getDescription();
}

Implement
getSearchable(). Retrieve the
EntityBasedSearchable that your application creates
to manage this object, and return it.

Define what options should appear on the context menu when a
BlackBerry
device user clicks on your entity in a list of search results. For more
information, see "Specify what users can do with your data in search results".

If you want this
SearchableEntity to display a different icon than
your application icon, provide the icon in
getIcon(). For more information, see "Customize the
appearance of your data in search results".