Class VectorSearchAlgorithmMetric

java.lang.Object
com.azure.core.util.ExpandableStringEnum<VectorSearchAlgorithmMetric>
com.azure.search.documents.indexes.models.VectorSearchAlgorithmMetric
All Implemented Interfaces:
com.azure.core.util.ExpandableEnum<String>

public final class VectorSearchAlgorithmMetric extends com.azure.core.util.ExpandableStringEnum<VectorSearchAlgorithmMetric>
The similarity metric to use for vector comparisons. It is recommended to choose the same similarity metric as the embedding model was trained on.
  • Field Details

    • COSINE

      public static final VectorSearchAlgorithmMetric COSINE
      Measures the angle between vectors to quantify their similarity, disregarding magnitude. The smaller the angle, the closer the similarity.
    • EUCLIDEAN

      public static final VectorSearchAlgorithmMetric EUCLIDEAN
      Computes the straight-line distance between vectors in a multi-dimensional space. The smaller the distance, the closer the similarity.
    • DOT_PRODUCT

      public static final VectorSearchAlgorithmMetric DOT_PRODUCT
      Calculates the sum of element-wise products to gauge alignment and magnitude similarity. The larger and more positive, the closer the similarity.
    • HAMMING

      public static final VectorSearchAlgorithmMetric HAMMING
      Only applicable to bit-packed binary data types. Determines dissimilarity by counting differing positions in binary vectors. The fewer differences, the closer the similarity.
  • Constructor Details

    • VectorSearchAlgorithmMetric

      @Deprecated public VectorSearchAlgorithmMetric()
      Deprecated.
      Use the fromString(String) factory method.
      Creates a new instance of VectorSearchAlgorithmMetric value.
  • Method Details

    • fromString

      public static VectorSearchAlgorithmMetric fromString(String name)
      Creates or finds a VectorSearchAlgorithmMetric from its string representation.
      Parameters:
      name - a name to look for.
      Returns:
      the corresponding VectorSearchAlgorithmMetric.
    • values

      public static Collection<VectorSearchAlgorithmMetric> values()
      Gets known VectorSearchAlgorithmMetric values.
      Returns:
      known VectorSearchAlgorithmMetric values.