You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Returns a `FLOAT` representing the distance between the two vector values based on the selected `vectorDistanceMetric` algorithm. label:new[Introduced in Neo4j 2025.xx]
| Returns a `FLOAT` representing the distance between the given vector and a vector of the same dimension with all coordinates set to zero, calculated using the specified `vectorDistanceMetric`. label:new[Introduced in Neo4j 2025.xx]
Copy file name to clipboardExpand all lines: modules/ROOT/pages/functions/list.adoc
+16-14Lines changed: 16 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -433,7 +433,7 @@ The property named `likedColors` and a `LIST<ANY>` comprising all but the first
433
433
| Any `BOOLEAN` value in `input` is preserved.
434
434
| If the `input` is `null`, `null` will be returned.
435
435
| If the `input` is not a `LIST<ANY>`, an error will be returned.
436
-
| The conversion for each value in `list` is done according to the xref::functions/scalar.adoc#functions-tobooleanornull[`toBooleanOrNull()` function].
436
+
| The conversion for each value in `input` is done according to the xref::functions/scalar.adoc#functions-tobooleanornull[`toBooleanOrNull()` function].
| *Description* 3+| Converts a `LIST<ANY>` to a `LIST<FLOAT>` values. If any values are not convertible to `FLOAT` they will be null in the `LIST<FLOAT>` returned.
473
+
| *Description* 3+| Converts a `LIST<ANY>` or a `VECTOR` to a `LIST<FLOAT>` values. If any values are not convertible to `FLOAT` they will be null in the `LIST<FLOAT>` returned.
| *Description* 3+| Converts a `LIST<ANY>` to a `LIST<INTEGER>` values. If any values are not convertible to `INTEGER` they will be null in the `LIST<INTEGER>` returned.
524
+
| *Description* 3+| Converts a `LIST<ANY>` or a `VECTOR` to a `LIST<INTEGER>` values. If any values are not convertible to `INTEGER` they will be null in the `LIST<INTEGER>` returned.
| If the `input` is `null`, `null` will be returned.
535
-
| If the `input` is not a `LIST<ANY>`, an error will be returned.
536
+
| If the `input` is not a `VECTOR` or a `LIST<ANY>`, an error will be returned.
537
+
| `input` accepts `VECTOR` values as of Neo4j 2025.xx
536
538
| The conversion for each value in `list` is done according to the xref::functions/scalar.adoc#functions-tointegerornull[`toIntegerOrNull()` function].
| `a` | `LIST<INTEGER \| FLOAT>` | A list representing the first vector.
22
-
| `b` | `LIST<INTEGER \| FLOAT>` | A list representing the second vector.
24
+
| `a` | `VECTOR` \| `LIST<INTEGER \| FLOAT>` | A list representing the first vector.
25
+
| `b` | `VECTOR` \| `LIST<INTEGER \| FLOAT>` | A list representing the second vector.
23
26
| *Returns* 3+| `FLOAT`
24
27
|===
25
28
@@ -36,6 +39,7 @@ For more details, see the {link-vector-indexes}#similarity-functions[vector inde
36
39
| The implementation is identical to that of the latest available vector index provider (`vector-2.0`).
37
40
| `vector.similarity.cosine()` returns the neighborhood of nodes along with their respective cosine similarity scores, sorted in descending order of similarity.
38
41
The similarity score range from `0` and `1`, with scores closer to `1` indicating a higher degree of similarity between the indexed vector and the query vector.
42
+
| The input arguments `a` and `b` accept `VECTOR` values as of Neo4j 2025.xx.
39
43
40
44
|===
41
45
@@ -48,8 +52,8 @@ The similarity score range from `0` and `1`, with scores closer to `1` indicatin
| `a` | `LIST<INTEGER \| FLOAT>` | A list representing the first vector.
52
-
| `b` | `LIST<INTEGER \| FLOAT>` | A list representing the second vector.
55
+
| `a` | `VECTOR` \| `LIST<INTEGER \| FLOAT>` | A list representing the first vector.
56
+
| `b` | `VECTOR` \| `LIST<INTEGER \| FLOAT>` | A list representing the second vector.
53
57
| *Returns* 3+| `FLOAT`
54
58
|===
55
59
@@ -66,6 +70,7 @@ For more details, see the {link-vector-indexes}#similarity-functions[vector inde
66
70
| The implementation is identical to that of the latest available vector index provider (`vector-2.0`).
67
71
| `vector.similarity.euclidean()` returns the neighborhood of nodes along with their respective Euclidean similarity scores, sorted in descending order of similarity.
68
72
The similarity score range from `0` and `1`, with scores closer to `1` indicating a higher degree of similarity between the indexed vector and the query vector.
73
+
| The input arguments `a` and `b` accept `VECTOR` values as of Neo4j 2025.xx.
69
74
70
75
|===
71
76
@@ -124,4 +129,24 @@ This returns the two nearest neighbors.
* Returns a `FLOAT` representing the distance between the given vector and a vector of the same dimension with all coordinates set to zero, calculated using the specified `vectorDistanceMetric`.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/values-and-types/casting-data.adoc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ The following functions are available for casting data values:
13
13
|===
14
14
| Function | Description
15
15
16
-
| toBoolean() | Converts a `STRING`, `INTEGER`, or `BOOLEAN` value to a `BOOLEAN` value.
16
+
| xref:functions/list.adoc#functions-toboolean[`toBoolean()`] | Converts a `STRING`, `INTEGER`, or `BOOLEAN` value to a `BOOLEAN` value.
17
17
18
18
| toBooleanList() | Converts a `LIST<ANY>` and returns a `LIST<BOOLEAN>` values.
19
19
If any values are not convertible to `BOOLEAN` they will be `null` in the `LIST<BOOLEAN>` returned.
@@ -24,15 +24,15 @@ For any other input value, `null` will be returned.
24
24
| toFloat() | Converts an `INTEGER`, `FLOAT`, or a `STRING` value to a `FLOAT` value.
25
25
Otherwise `null` is returned.
26
26
27
-
| toFloatList() | Converts a `LIST<ANY>` and returns a `LIST<FLOAT>` values.
27
+
| toFloatList() | Converts a `LIST<ANY>` or, as of Neo4j 2025.xx, a `VECTOR` and returns a `LIST<FLOAT>` values.
28
28
If any values are not convertible to `FLOAT` they will be `null` in the `LIST<FLOAT>` returned.
29
29
30
30
| toFloatOrNull() | Converts an `INTEGER`, `FLOAT`, or a `STRING` value to a `FLOAT`.
31
31
For any other input value, `null` will be returned.
32
32
33
33
| toInteger() | Converts a `BOOLEAN`, `INTEGER`, `FLOAT` or a `STRING` value to an `INTEGER` value.
34
34
35
-
| toIntegerList() | Converts a `LIST<ANY>` to a `LIST<INTEGER>` values. If any values are not convertible to `INTEGER` they will be null in the `LIST<INTEGER>` returned.
35
+
| toIntegerList() | Converts a `LIST<ANY>` or, as of Neo4j 2025.xx, a `VECTOR` to a `LIST<INTEGER>` values. If any values are not convertible to `INTEGER` they will be null in the `LIST<INTEGER>` returned.
36
36
37
37
| toIntegerOrNull() | Converts a `BOOLEAN`, `INTEGER`, `FLOAT` or a `STRING` value to an `INTEGER` value.
38
38
For any other input value, `null` will be returned.
@@ -144,3 +145,12 @@ If they have the same time and offset but different named time zones, they are s
144
145
* Duration values cannot be directly compared.
145
146
Since the length of a day, month, or year varies, Cypher does not define a strict ordering for durations.
146
147
As a result, comparing two durations `(e.g, duration1 < duration2)` will always return `null`.
148
+
149
+
[[ordering-vector]]
150
+
=== Ordering vector values
151
+
152
+
Similar to spatial values, vectors cannot be compared using the operators (<, >, >= and <=)
153
+
154
+
Vectors of different coordinate type values are ordered by the coordinate type, this means the current order is: INTEGER8, INTEGER16, INTEGER32, INTEGER64, FLOAT32, FLOAT64
155
+
Within the same coordinate type, vectors are then ordered by their dimension, with smaller first (e.g Vector(1024) before Vector(2048)).
156
+
Vectors of the same coordinate type and dimension are then ordered pairwise (similar to how lists are ordered e.g Vector([1, 2]) is ordered before a Vector([2, 1])).
0 commit comments