Skip to content

Commit 814cbbc

Browse files
authored
Update vectordistance.md
1 parent 4ed2884 commit 814cbbc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

articles/cosmos-db/nosql/query/vectordistance.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,15 @@ VECTORDISTANCE(<vector_expr1>, <vector_expr2>, [<bool_expr>], [<obj_expr>])
3636
| **`spatial_expr_2`** | An array of `float32` or smaller.|
3737
| **`bool_expr`** | A boolean specifying how the computed value is used in an ORDER BY expression. If `true`, then brute force is used. A value of `false` will leverage any index defined on the vector property, if it exists. Default value is `false`.|
3838
|**`obj_expr`**| A JSON formatted object literal used to specify options for the vector distance calculation. Valid items include `distanceFunction` and `dataType`.|
39-
| **`distanceFunction`** | The metric used to compute distance/similarity. Supported metrics are: [cosine](https://en.wikipedia.org/wiki/Cosine_similarity), [dotproduct](https://en.wikipedia.org/wiki/Dot_product), and [euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) (default cosine).|
39+
| **`distanceFunction`** | The metric used to compute distance/similarity.
4040
| **`dataType`** | The data type of the vectors. `float32`, `float16`, `int8`, `uint8` values. Default value is `float32`. |
4141

42+
43+
Supported metrics for `distanceFunction` are:
44+
* [cosine](https://en.wikipedia.org/wiki/Cosine_similarity) which has values from -1 (least similar) to +1 (most similar).
45+
* [dotproduct](https://en.wikipedia.org/wiki/Dot_product) which has values from -inf (least simialr) to +inf (most similar).
46+
* [euclidean](https://en.wikipedia.org/wiki/Euclidean_distance), which has values from 0 (most similar) to +inf) (least similar).
47+
4248
## Return types
4349

4450
Returns a numeric expression that enumerates the similarity score between two expressions.

0 commit comments

Comments
 (0)