Class SingleVectorFieldResult

java.lang.Object
com.azure.search.documents.models.SingleVectorFieldResult
All Implemented Interfaces:
com.azure.json.JsonSerializable<SingleVectorFieldResult>

public final class SingleVectorFieldResult extends Object implements com.azure.json.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

    Constructors
    Constructor
    Description
    Creates an instance of SingleVectorFieldResult class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of SingleVectorFieldResult from the JsonReader.
    Get the searchScore property: The @search.score value that is calculated from the vector similarity score.
    Get the vectorSimilarity property: The vector similarity score for this document.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • SingleVectorFieldResult

      public SingleVectorFieldResult()
      Creates an instance of SingleVectorFieldResult class.
  • Method Details

    • 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 com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<SingleVectorFieldResult>
      Throws:
      IOException
    • fromJson

      public static SingleVectorFieldResult fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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.