Share via


SingleVectorFieldResult Class

  • java.lang.Object
    • com.azure.search.documents.models.SingleVectorFieldResult

Implements

public final class SingleVectorFieldResult
implements JsonSerializable<SingleVectorFieldResult>

A single vector field result. Both @search.score and vector similarity values are returned. Vector similarity is related to @search.score by an equation.

Constructor Summary

Constructor Description
SingleVectorFieldResult()

Creates an instance of SingleVectorFieldResult class.

Method Summary

Modifier and Type Method and Description
static SingleVectorFieldResult fromJson(JsonReader jsonReader)

Reads an instance of SingleVectorFieldResult from the JsonReader.

Double getSearchScore()

Get the searchScore property: The @search.score value that is calculated from the vector similarity score.

Double getVectorSimilarity()

Get the vectorSimilarity property: The vector similarity score for this document.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

SingleVectorFieldResult

public SingleVectorFieldResult()

Creates an instance of SingleVectorFieldResult class.

Method Details

fromJson

public static SingleVectorFieldResult fromJson(JsonReader jsonReader)

Reads an instance of SingleVectorFieldResult from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of SingleVectorFieldResult if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the SingleVectorFieldResult.

getSearchScore

public Double getSearchScore()

Get the searchScore property: The @search.score value that is calculated from the vector similarity score. This is the score that's visible in a pure single-field single-vector query.

Returns:

the searchScore value.

getVectorSimilarity

public Double getVectorSimilarity()

Get the vectorSimilarity property: The vector similarity score for this document. Note this is the canonical definition of similarity metric, not the 'distance' version. For example, cosine similarity instead of cosine distance.

Returns:

the vectorSimilarity value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to