# SearchResult.MatchInfo.Builder

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/app/SearchResult.java+class:androidx.appsearch.app.SearchResult.MatchInfo.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
public final class SearchResult.MatchInfo.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo` objects.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo.Builder#Builder(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html propertyPath)` Creates a new `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo.Builder` reporting a match with the given property path. |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo` | `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo.Builder#build()()` Constructs a new `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo.Builder` | `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo.Builder#setEmbeddingMatch(androidx.appsearch.app.SearchResult.EmbeddingMatchInfo)( @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/appsearch/app/SearchResult.EmbeddingMatchInfo embeddingMatch )` Sets the `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.EmbeddingMatchInfo` corresponding to the given entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo.Builder#setExactMatchRange(androidx.appsearch.app.SearchResult.MatchRange)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange matchRange)` Sets the exact `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange` corresponding to the given entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo.Builder#setSnippetRange(androidx.appsearch.app.SearchResult.MatchRange)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange matchRange)` Sets the snippet `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange` corresponding to the given entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo.Builder#setSubmatchRange(androidx.appsearch.app.SearchResult.MatchRange)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange matchRange)` Sets the submatch `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange` corresponding to the given entry. |

## Public constructors

### Builder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public Builder(@NonNull String propertyPath)
```

Creates a new `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo.Builder` reporting a match with the given property path.

A property path is a dot-delimited sequence of property names indicating which property in the document these snippets correspond to.

Example properties: 'body', 'sender.name', 'sender.emailaddress', etc. For class example 1, this returns "subject".

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html propertyPath` | A dot-delimited sequence of property names indicating which property in the document these snippets correspond to. |

## Public methods

### build

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @NonNull SearchResult.MatchInfo build()
```

Constructs a new `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchInfo`.

### setEmbeddingMatch

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
@ExperimentalAppSearchApi
public @NonNull SearchResult.MatchInfo.Builder setEmbeddingMatch(
    @Nullable SearchResult.EmbeddingMatchInfo embeddingMatch
)
```

Sets the `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.EmbeddingMatchInfo` corresponding to the given entry.

### setExactMatchRange

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @NonNull SearchResult.MatchInfo.Builder setExactMatchRange(@NonNull SearchResult.MatchRange matchRange)
```

Sets the exact `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange` corresponding to the given entry.

### setSnippetRange

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @NonNull SearchResult.MatchInfo.Builder setSnippetRange(@NonNull SearchResult.MatchRange matchRange)
```

Sets the snippet `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange` corresponding to the given entry.

### setSubmatchRange

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @NonNull SearchResult.MatchInfo.Builder setSubmatchRange(@NonNull SearchResult.MatchRange matchRange)
```

Sets the submatch `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange` corresponding to the given entry.