Package com.google.cloud.firestore
Enum VectorQuery.DistanceMeasure
- All Implemented Interfaces:
Serializable,Comparable<VectorQuery.DistanceMeasure>
- Enclosing class:
- VectorQuery
The distance measure to use when comparing vectors in a
VectorQuery.-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCOSINE distance compares vectors based on the angle between them, which allows you to measure similarity that isn't based on the vectors' magnitude.Similar to cosine but is affected by the magnitude of the vectors.Measures the EUCLIDEAN distance between the vectors. -
Method Summary
Modifier and TypeMethodDescriptionstatic VectorQuery.DistanceMeasureReturns the enum constant of this type with the specified name.static VectorQuery.DistanceMeasure[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
COSINE
COSINE distance compares vectors based on the angle between them, which allows you to measure similarity that isn't based on the vectors' magnitude. We recommend using DOT_PRODUCT with unit normalized vectors instead of COSINE distance, which is mathematically equivalent with better performance. -
EUCLIDEAN
Measures the EUCLIDEAN distance between the vectors. -
DOT_PRODUCT
Similar to cosine but is affected by the magnitude of the vectors.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-