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. See Cosine
Similarity to learn
more about COSINE similarity and COSINE distance. The resulting COSINE
distance decreases the more similar two vectors are.
DotProduct
Similar to cosine but is affected by the magnitude of the vectors. See
Dot Product to learn more.
The resulting distance increases the more similar two vectors are.
Euclidean
Measures the EUCLIDEAN distance between the vectors. See
Euclidean to learn
more. The resulting distance decreases the more similar two vectors are.
[[["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\u003eThis page provides documentation for the \u003ccode\u003eFindNearest.Types.DistanceMeasure\u003c/code\u003e enum within the Google Cloud Datastore v1 API, specifically within the .NET environment.\u003c/p\u003e\n"],["\u003cp\u003eThe enum \u003ccode\u003eFindNearest.Types.DistanceMeasure\u003c/code\u003e defines various methods for measuring the distance between vectors, including \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 latest version documented on this page is 4.15.0, with additional versions listed ranging down to version 3.2.0, each linking to their respective documentation for \u003ccode\u003eFindNearest.Types.DistanceMeasure\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEach distance measure type (\u003ccode\u003eCosine\u003c/code\u003e, \u003ccode\u003eDotProduct\u003c/code\u003e, \u003ccode\u003eEuclidean\u003c/code\u003e) includes a description and a link to the corresponding Wikipedia article for further reference.\u003c/p\u003e\n"]]],[],null,[]]