SearchResult.EmbeddingMatchInfo
public
static
final
class
SearchResult.EmbeddingMatchInfo
extends Object
implements
Parcelable
java.lang.Object | |
↳ | 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
EmbeddingVector
in the list returned bySearchSpec.getEmbeddingParameters()
- the embedding search metric type for the corresponding query
Summary
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Creator<SearchResult.EmbeddingMatchInfo> |
CREATOR
|
Public constructors | |
---|---|
EmbeddingMatchInfo(double semanticScore, int queryEmbeddingVectorIndex, int embeddingSearchMetricType)
Creates a new immutable EmbeddingMatchInfo. |
Public methods | |
---|---|
int
|
getEmbeddingSearchMetricType()
Gets the embedding search metric type that this embedding match corresponds to. |
int
|
getQueryEmbeddingVectorIndex()
Gets the index of the query vector that this embedding match corresponds to. |
double
|
getSemanticScore()
Gets the semantic score corresponding to the embedding match. |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
---|---|
Fields
CREATOR
public static final Creator<SearchResult.EmbeddingMatchInfo> CREATOR
Public constructors
EmbeddingMatchInfo
public EmbeddingMatchInfo (double semanticScore, int queryEmbeddingVectorIndex, int embeddingSearchMetricType)
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 SearchSpec.EMBEDDING_SEARCH_METRIC_TYPE_DEFAULT , SearchSpec.EMBEDDING_SEARCH_METRIC_TYPE_COSINE , SearchSpec.EMBEDDING_SEARCH_METRIC_TYPE_DOT_PRODUCT , or SearchSpec.EMBEDDING_SEARCH_METRIC_TYPE_EUCLIDEAN |
Public methods
getEmbeddingSearchMetricType
public int getEmbeddingSearchMetricType ()
Gets the embedding search metric type that this embedding match corresponds to.
getQueryEmbeddingVectorIndex
public int getQueryEmbeddingVectorIndex ()
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()
Returns | |
---|---|
int |
getSemanticScore
public double getSemanticScore ()
Gets the semantic score corresponding to the embedding match.
Returns | |
---|---|
double |
writeToParcel
public void writeToParcel (Parcel dest, int flags)
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.PARCELABLE_WRITE_RETURN_VALUE .
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |