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"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe content provides documentation for the \u003ccode\u003eStructuredQuery.Types.FindNearest.Types.DistanceMeasure\u003c/code\u003e enum in the Firestore v1 API.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version available is 3.10.0, with documentation also available for versions ranging from 2.3.0 to 3.9.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDistanceMeasure\u003c/code\u003e enum defines how vectors are compared and includes options for \u003ccode\u003eCosine\u003c/code\u003e, \u003ccode\u003eDotProduct\u003c/code\u003e, \u003ccode\u003eEuclidean\u003c/code\u003e, and \u003ccode\u003eUnspecified\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation provides links to Wikipedia articles to learn more about \u003ccode\u003eCosine Similarity\u003c/code\u003e, \u003ccode\u003eDot Product\u003c/code\u003e, and \u003ccode\u003eEuclidean\u003c/code\u003e distance, in order to better understand the differences between them.\u003c/p\u003e\n"]]],[],null,[]]