Język

EmbeddingSearchMetricType Enum

Definition

Selects the metric used for embedding comparisons.

public enum EmbeddingSearchMetricType
type EmbeddingSearchMetricType = 
Inheritance
EmbeddingSearchMetricType

Fields

Name Value Description
Default 0

Use the default metric set in SearchSpec.getDefaultEmbeddingSearchMetricType() for embedding search and ranking.

Android reference for android.app.appsearch.SearchSpec.EMBEDDING_SEARCH_METRIC_TYPE_DEFAULT.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Cosine 1

Cosine similarity as metric for embedding search and ranking.

Android reference for android.app.appsearch.SearchSpec.EMBEDDING_SEARCH_METRIC_TYPE_COSINE.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

DotProduct 2

Dot product similarity as metric for embedding search and ranking.

Android reference for android.app.appsearch.SearchSpec.EMBEDDING_SEARCH_METRIC_TYPE_DOT_PRODUCT.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Euclidean 3

Euclidean distance as metric for embedding search and ranking.

Android reference for android.app.appsearch.SearchSpec.EMBEDDING_SEARCH_METRIC_TYPE_EUCLIDEAN.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Remarks

The choices include the configured default, cosine similarity, dot product, and Euclidean distance.

Applies to