Class VectorSimilarityThreshold

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

public final class VectorSimilarityThreshold extends VectorThreshold
The results of the vector query will be filtered based on the vector similarity metric. Note this is the canonical definition of similarity metric, not the 'distance' version. The threshold direction (larger or smaller) will be chosen automatically according to the metric used by the field.
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of VectorSimilarityThreshold from the JsonReader.
    Get the kind property: The kind of threshold used to filter vector queries.
    double
    Get the value property: The threshold will filter based on the similarity metric value.
    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

    • VectorSimilarityThreshold

      public VectorSimilarityThreshold(double value)
      Creates an instance of VectorSimilarityThreshold class.
      Parameters:
      value - the value value to set.
  • Method Details

    • getKind

      public VectorThresholdKind getKind()
      Get the kind property: The kind of threshold used to filter vector queries.
      Overrides:
      getKind in class VectorThreshold
      Returns:
      the kind value.
    • getValue

      public double getValue()
      Get the value property: The threshold will filter based on the similarity metric value. Note this is the canonical definition of similarity metric, not the 'distance' version. The threshold direction (larger or smaller) will be chosen automatically according to the metric used by the field.
      Returns:
      the value value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<VectorThreshold>
      Overrides:
      toJson in class VectorThreshold
      Throws:
      IOException
    • fromJson

      public static VectorSimilarityThreshold fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of VectorSimilarityThreshold from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of VectorSimilarityThreshold if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the VectorSimilarityThreshold.