Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [T Extensions 18](https://developer.android.com/sdkExtensions)

# EmbeddingMatchInfo

*** ** * ** ***

```
class EmbeddingMatchInfo : Parcelable
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.app.appsearch.SearchResult.EmbeddingMatchInfo](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchResult.EmbeddingMatchInfo#) |

This class represents match objects for any snippets that might be present in `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchResults` from an embedding query. Using this class, you can get:

- the semantic score of the matching vector with the embedding query
- the query embedding vector index - the index of the query `https://developer.android.com/reference/kotlin/android/app/appsearch/EmbeddingVector` in the list returned by `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec#getEmbeddingParameters()`
- the embedding search metric type for the corresponding query

for each vector match in the document.

<br />

## Summary

| Inherited constants ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` Descriptor bit used with `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` Flag for use with `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchResult.EmbeddingMatchInfo#EmbeddingMatchInfo(kotlin.Double,%20kotlin.Int,%20kotlin.Int)(semanticScore: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html, queryEmbeddingVectorIndex: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, embeddingSearchMetricType: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Creates a new immutable EmbeddingMatchInfo. |

| Public methods ||
|---|---|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchResult.EmbeddingMatchInfo#describeContents()()` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchResult.EmbeddingMatchInfo#getEmbeddingSearchMetricType()()` Gets the embedding search metric type that this embedding match corresponds to. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchResult.EmbeddingMatchInfo#getQueryEmbeddingVectorIndex()()` Gets the index of the query vector that this embedding match corresponds to. |
| [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html) | `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchResult.EmbeddingMatchInfo#getSemanticScore()()` Gets the semantic score corresponding to the embedding match. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchResult.EmbeddingMatchInfo#writeToParcel(android.os.Parcel,%20kotlin.Int)(dest: https://developer.android.com/reference/kotlin/android/os/Parcel.html#, flags: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Flatten this object in to a Parcel. |

| Properties ||
|---|---|
| static [Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.html#)\<[SearchResult.EmbeddingMatchInfo](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchResult.EmbeddingMatchInfo#)!\> | `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchResult.EmbeddingMatchInfo#CREATOR:android.os.Parcelable.Creator` <br /> |

## Public constructors

### EmbeddingMatchInfo

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [T Extensions 18](https://developer.android.com/sdkExtensions)

```
EmbeddingMatchInfo(
    semanticScore: Double, 
    queryEmbeddingVectorIndex: Int, 
    embeddingSearchMetricType: Int)
```

Creates a new immutable EmbeddingMatchInfo.

| Parameters ||
|---|---|
| `semanticScore` | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html): the semantic score of the embedding match against the query vector. |
| `queryEmbeddingVectorIndex` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the index of the matched query embedding vector in `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec#getEmbeddingParameters()` |
| `embeddingSearchMetricType` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the search metric type used to calculate the score for the match and the query vector. Value is one of the following: - `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec#EMBEDDING_SEARCH_METRIC_TYPE_DEFAULT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec#EMBEDDING_SEARCH_METRIC_TYPE_COSINE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec#EMBEDDING_SEARCH_METRIC_TYPE_DOT_PRODUCT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec#EMBEDDING_SEARCH_METRIC_TYPE_EUCLIDEAN:kotlin.Int` |

## Public methods

### describeContents

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun describeContents(): Int
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)`, the return value of this method must include the `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` bit.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` |

### getEmbeddingSearchMetricType

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [T Extensions 18](https://developer.android.com/sdkExtensions)

```
fun getEmbeddingSearchMetricType(): Int
```

Gets the embedding search metric type that this embedding match corresponds to.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | Value is one of the following: - `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec#EMBEDDING_SEARCH_METRIC_TYPE_DEFAULT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec#EMBEDDING_SEARCH_METRIC_TYPE_COSINE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec#EMBEDDING_SEARCH_METRIC_TYPE_DOT_PRODUCT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec#EMBEDDING_SEARCH_METRIC_TYPE_EUCLIDEAN:kotlin.Int` |

### getQueryEmbeddingVectorIndex

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [T Extensions 18](https://developer.android.com/sdkExtensions)

```
fun getQueryEmbeddingVectorIndex(): Int
```

Gets the index of the query vector that this embedding match corresponds to. This is the index of the query `https://developer.android.com/reference/kotlin/android/app/appsearch/EmbeddingVector` in the list returned by `https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec#getEmbeddingParameters()`

### getSemanticScore

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [T Extensions 18](https://developer.android.com/sdkExtensions)

```
fun getSemanticScore(): Double
```

Gets the semantic score corresponding to the embedding match.

### writeToParcel

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun writeToParcel(
    dest: Parcel, 
    flags: Int
): Unit
```

Flatten this object in to a Parcel.

| Parameters ||
|---|---|
| `dest` | [Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#): This value cannot be `null`. |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` |

## Properties

### CREATOR

Added in [API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [T Extensions 18](https://developer.android.com/sdkExtensions)

```
static val CREATOR: Parcelable.Creator<SearchResult.EmbeddingMatchInfo!>
```