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. See Cosine
Similarity to learn
more.
DotProduct
Similar to cosine but is affected by the magnitude of the vectors. See
Dot Product to learn more.
Euclidean
Measures the EUCLIDEAN distance between the vectors. See
Euclidean to learn
more
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-21 UTC."],[[["The content provides documentation for the `StructuredQuery.Types.FindNearest.Types.DistanceMeasure` enum in the Firestore v1 API."],["The latest version available is 3.10.0, with documentation also available for versions ranging from 2.3.0 to 3.9.0."],["The `DistanceMeasure` enum defines how vectors are compared and includes options for `Cosine`, `DotProduct`, `Euclidean`, and `Unspecified`."],["The documentation provides links to Wikipedia articles to learn more about `Cosine Similarity`, `Dot Product`, and `Euclidean` distance, in order to better understand the differences between them."]]],[]]