# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Nested Classes | Methods | Inherited Methods

# SearchResult

`public final class SearchResult`
`extends Object` ``

java.lang.Object
↳ | android.app.appsearch.SearchResult

This class represents one of the results obtained from an AppSearch query.

This allows clients to obtain:

- The document which matched, using `getGenericDocument()`
- Information about which properties in the document matched, and "snippet" information containing textual summaries of the document's matches, using `getMatchInfos()`

"Snippet" refers to a substring of text from the content of document that is returned as a part of search result.

See also:

- `SearchResults`

## Summary

### Nested classes
`class` | `SearchResult.Builder` Builder for `SearchResult` objects.
`class` | `SearchResult.MatchInfo` This class represents a match objects for any Snippets that might be present in `SearchResults` from query.
`class` | `SearchResult.MatchRange` Class providing the position range of matching information.

### Public methods
`String` | `getDatabaseName()` Contains the database name that stored the `GenericDocument`.
`GenericDocument` | `getGenericDocument()` Contains the matching `GenericDocument`.
`List<SearchResult.MatchInfo>` | `getMatchInfos()` Returns a list of `MatchInfo`s providing information about how the document in `getGenericDocument()` matched the query.
`String` | `getPackageName()` Contains the package name of the app that stored the `GenericDocument`.
`double` | `getRankingSignal()` Returns the ranking signal of the `GenericDocument`, according to the ranking strategy set in `SearchSpec.Builder#setRankingStrategy(int)`.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public methods

### getDatabaseName

    public String getDatabaseName ()

Contains the database name that stored the `GenericDocument`.

Returns
`String` | Name of the database within which the document is stored This value cannot be `null`.

### getGenericDocument

    public GenericDocument getGenericDocument ()

Contains the matching `GenericDocument`.

Returns
`GenericDocument` | Document object which matched the query. This value cannot be `null`.

### getMatchInfos

    public List<SearchResult.MatchInfo> getMatchInfos ()

Returns a list of `MatchInfo`s providing information about how the document in `getGenericDocument()` matched the query.

Returns
`List<SearchResult.MatchInfo>` | List of matches based on `SearchSpec`. If snippeting is disabled using `SearchSpec.Builder.setSnippetCount(int)` or `SearchSpec.Builder.setSnippetCountPerProperty(int)`, for all results after that value, this method returns an empty list. This value cannot be `null`.

### getPackageName

    public String getPackageName ()

Contains the package name of the app that stored the `GenericDocument`.

Returns
`String` | Package name that stored the document This value cannot be `null`.

### getRankingSignal

    public double getRankingSignal ()

Returns the ranking signal of the `GenericDocument`, according to the ranking strategy set in `SearchSpec.Builder#setRankingStrategy(int)`.

The meaning of the ranking signal and its value is determined by the selected ranking strategy:

- `SearchSpec#RANKING_STRATEGY_NONE` - this value will be 0
- `SearchSpec#RANKING_STRATEGY_DOCUMENT_SCORE` - the value returned by calling `GenericDocument#getScore()` on the document returned by `getGenericDocument()`
- `SearchSpec#RANKING_STRATEGY_CREATION_TIMESTAMP` - the value returned by calling `GenericDocument#getCreationTimestampMillis()` on the document returned by `getGenericDocument()`
- `SearchSpec#RANKING_STRATEGY_RELEVANCE_SCORE` - an arbitrary double value where a higher value means more relevant
- `SearchSpec#RANKING_STRATEGY_USAGE_COUNT` - the number of times usage has been reported for the document returned by `getGenericDocument()`
- `SearchSpec#RANKING_STRATEGY_USAGE_LAST_USED_TIMESTAMP` - the timestamp of the most recent usage that has been reported for the document returned by `getGenericDocument()`

Returns
`double` | Ranking signal of the document

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*