EmbeddingMatchInfo
class EmbeddingMatchInfo : Parcelable
| kotlin.Any | |
| ↳ | android.app.appsearch.SearchResult.EmbeddingMatchInfo |
This class represents match objects for any snippets that might be present in 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
EmbeddingVectorin the list returned bySearchSpec.getEmbeddingParameters() - the embedding search metric type for the corresponding query
Summary
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
EmbeddingMatchInfo(semanticScore: Double, queryEmbeddingVectorIndex: Int, embeddingSearchMetricType: Int)Creates a new immutable EmbeddingMatchInfo. |
|
| Public methods | |
|---|---|
| Int | |
| Int |
Gets the embedding search metric type that this embedding match corresponds to. |
| Int |
Gets the index of the query vector that this embedding match corresponds to. |
| Double |
Gets the semantic score corresponding to the embedding match. |
| Unit |
writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<SearchResult.EmbeddingMatchInfo!> | |
Public constructors
EmbeddingMatchInfo
EmbeddingMatchInfo(
semanticScore: Double,
queryEmbeddingVectorIndex: Int,
embeddingSearchMetricType: Int)
Creates a new immutable EmbeddingMatchInfo.
| Parameters | |
|---|---|
semanticScore |
Double: the semantic score of the embedding match against the query vector. |
queryEmbeddingVectorIndex |
Int: the index of the matched query embedding vector in SearchSpec.getEmbeddingParameters() |
embeddingSearchMetricType |
Int: the search metric type used to calculate the score for the match and the query vector. Value is one of the following: |
Public methods
describeContents
fun describeContents(): Int
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
getEmbeddingSearchMetricType
fun getEmbeddingSearchMetricType(): Int
Gets the embedding search metric type that this embedding match corresponds to.
| Return | |
|---|---|
Int |
Value is one of the following: |
getQueryEmbeddingVectorIndex
fun getQueryEmbeddingVectorIndex(): Int
Gets the index of the query vector that this embedding match corresponds to. This is the index of the query EmbeddingVector in the list returned by SearchSpec.getEmbeddingParameters()
getSemanticScore
fun getSemanticScore(): Double
Gets the semantic score corresponding to the embedding match.
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
Parcel: This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of the following:
|
Properties
CREATOR
static val CREATOR: Parcelable.Creator<SearchResult.EmbeddingMatchInfo!>