VectorSearchAlgorithmMetric Class
- java.
lang. Object - com.
azure. core. util. ExpandableStringEnum<T> - com.
azure. search. documents. indexes. models. VectorSearchAlgorithmMetric
- com.
- com.
public final class VectorSearchAlgorithmMetric
extends 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 Summary
| Modifier and Type | Field and Description |
|---|---|
|
static final
Vector |
COSINE
Measures the angle between vectors to quantify their similarity, disregarding magnitude. |
|
static final
Vector |
DOT_PRODUCT
Calculates the sum of element-wise products to gauge alignment and magnitude similarity. |
|
static final
Vector |
EUCLIDEAN
Computes the straight-line distance between vectors in a multi-dimensional space. |
|
static final
Vector |
HAMMING
Only applicable to bit-packed binary data types. |
Constructor Summary
| Constructor | Description |
|---|---|
| VectorSearchAlgorithmMetric() |
Deprecated
Use the fromString(String name) factory method.
Creates a new instance of Vector |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Vector |
fromString(String name)
Creates or finds a Vector |
|
static
Collection<Vector |
values()
Gets known Vector |
Methods inherited from ExpandableStringEnum
Methods inherited from java.lang.Object
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.
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.
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.
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
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:
Returns:
values
public static Collection<VectorSearchAlgorithmMetric> values()
Gets known VectorSearchAlgorithmMetric values.
Returns: