SearchResult.EmbeddingMatchInfo


@ExperimentalAppSearchApi
class 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 by getEmbeddingParameters
  • the embedding search metric type for the corresponding query
for each vector match in the document.

Summary

Public constructors

@ExperimentalAppSearchApi
EmbeddingMatchInfo(
    semanticScore: Double,
    queryEmbeddingVectorIndex: Int,
    embeddingSearchMetricType: Int
)

Creates a new immutable EmbeddingMatchInfo.

Public functions

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.

Public constructors

EmbeddingMatchInfo

Added in 1.1.0-rc01
@ExperimentalAppSearchApi
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 getEmbeddingParameters

embeddingSearchMetricType: Int

the search metric type used to calculate the score for the match and the query vector

Public functions

getEmbeddingSearchMetricType

Added in 1.1.0-rc01
@ExperimentalAppSearchApi
fun getEmbeddingSearchMetricType(): Int

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

getQueryEmbeddingVectorIndex

Added in 1.1.0-rc01
@ExperimentalAppSearchApi
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 getEmbeddingParameters

getSemanticScore

Added in 1.1.0-rc01
@ExperimentalAppSearchApi
fun getSemanticScore(): Double

Gets the semantic score corresponding to the embedding match.