Language

SearchSpec.Builder.SetDefaultEmbeddingSearchMetricType(Int32) Method

Definition

Sets the default embedding metric type used for search and ranking.

[Android.Runtime.Register("setDefaultEmbeddingSearchMetricType", "(I)Landroid/app/appsearch/SearchSpec$Builder;", "", ApiSince=36)]
public Android.App.AppSearch.SearchSpec.Builder SetDefaultEmbeddingSearchMetricType(int defaultEmbeddingSearchMetricType);
[<Android.Runtime.Register("setDefaultEmbeddingSearchMetricType", "(I)Landroid/app/appsearch/SearchSpec$Builder;", "", ApiSince=36)>]
member this.SetDefaultEmbeddingSearchMetricType : int -> Android.App.AppSearch.SearchSpec.Builder

Parameters

defaultEmbeddingSearchMetricType
Int32

Value is one of the following: SearchSpec.EMBEDDING_SEARCH_METRIC_TYPE_COSINE SearchSpec.EMBEDDING_SEARCH_METRIC_TYPE_DOT_PRODUCT SearchSpec.EMBEDDING_SEARCH_METRIC_TYPE_EUCLIDEAN

Returns

This builder instance.

Attributes

Remarks

Sets the default embedding metric type used for search and ranking. If this method is not called, the default is EmbeddingSearchMetricTypeCosine. Metrics specified within the "semanticSearch" or "matchedSemanticScores" functions in search or ranking expressions override this default.

Android reference for android.app.appsearch.SearchSpec.Builder.setDefaultEmbeddingSearchMetricType.

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.

Applies to