Skip to content

Commit b12a42a

Browse files
fallback map and results (not genai plugin)
1 parent df674b5 commit b12a42a

File tree

4 files changed

+49
-26
lines changed

4 files changed

+49
-26
lines changed

modules/ROOT/pages/functions/vector.adoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,35 +44,35 @@ This includes the potential of lossy conversion in cases where a larger type, e.
4444
[source, cypher]
4545
----
4646
WITH vector([1, 2, 3], 3, INTEGER) AS vector
47-
RETURN vector, valueType(vector) AS vectorType
47+
RETURN vector
4848
----
4949
5050
.Result
51-
[role="queryresult",options="header,footer",cols="2*<m"]
51+
[role="queryresult",options="header,footer",cols="1*<m"]
5252
|===
53-
| vector | vectorType
53+
| vector
5454
55-
| [1, 2, 3] | "VECTOR<INTEGER NOT NULL>(3) NOT NULL"
55+
| vector([1, 2, 3], 3, INTEGER NOT NULL)
5656
57-
2+d|Rows: 1
57+
1+d|Rows: 1
5858
|===
5959
6060
6161
.Construct a `VECTOR` value with a `STRING` `vectorValue`
6262
[source, cypher]
6363
----
6464
WITH vector("[1.05000e+00, 0.123, 5]", 3, FLOAT32) as vector
65-
RETURN vector, valueType(vector) AS vectorType
65+
RETURN vector
6666
----
6767
6868
.Result
69-
[role="queryresult",options="header,footer",cols="2*<m"]
69+
[role="queryresult",options="header,footer",cols="1*<m"]
7070
|===
71-
| vector | vectorType
71+
| vector
7272
73-
| | "VECTOR<FLOAT32 NOT NULL>(3) NOT NULL"
73+
| vector([1.05, 0.123, 5.0], 3, FLOAT32 NOT NULL)
7474
75-
2+d|Rows: 1
75+
1+d|Rows: 1
7676
|===
7777
7878
.`null` values

modules/ROOT/pages/values-and-types/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ More information about the data values and types supported by Cypher can be foun
1313
* xref:values-and-types/spatial.adoc[]
1414
* xref:values-and-types/lists.adoc[]
1515
* xref:values-and-types/maps.adoc[]
16-
* xref:values-and-types/vector.adoc[] label:cypher[Cypher 25 only] label:new[Introduced in Neo4j 2025.xx]
16+
* xref:values-and-types/vector.adoc[] label:new[Introduced in Neo4j 2025.xx]
1717
* xref:values-and-types/graph-references.adoc[]
1818
* xref::values-and-types/working-with-null.adoc[]
1919
* xref::values-and-types/casting-data.adoc[]

modules/ROOT/pages/values-and-types/ordering-equality-comparison.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Values of different types are ordered based on a predefined hierarchy, from leas
5151
* xref::values-and-types/property-structural-constructed.adoc#structural-types[`RELATIONSHIP`]
5252
* xref::values-and-types/lists.adoc[`LIST`]
5353
* xref::patterns/fixed-length-patterns.adoc#path-patterns[`PATH`]
54-
* xref::values-and-types/vector.adoc[`VECTOR`] label:cypher[Cypher 25 only] label:new[Introduced in Neo4j 2025.xx]
54+
* xref::values-and-types/vector.adoc[`VECTOR`]
5555
* xref::values-and-types/spatial.adoc[`POINT`]
5656
* xref::values-and-types/temporal.adoc[`ZONED DATETIME`]
5757
* xref::values-and-types/temporal.adoc[`LOCAL DATETIME`]

modules/ROOT/pages/values-and-types/vector.adoc

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
= Vectors
22
:description: Information about Cypher's `VECTOR` type.
3-
:page-role: cypher-25-only new-neo4j-2025.xx
4-
3+
:page-role: new-neo4j-2025.xx
54

65
Cypher supports the construction of a `VECTOR` value that can be stored as xref:indexes/semantic-indexes/vector-indexes.adoc#embeddings[embedding] properties on nodes and relationships and utilized for efficient semantic retrieval using Neo4j's xref:indexes/semantic-indexes/vector-indexes.adoc[vector indexes] and xref:genai-integrations.adoc[GenAI plugin].
76
`VECTOR` values can also be measured and compared (in terms of similarity, distance, and norm) using Cypher's xref:functions/vector.adoc[Vector functions].
@@ -66,7 +65,6 @@ See also:
6665
To construct a `VECTOR` value, use the xref:functions/vector.adoc#functions-vector[`vector()`] function.
6766

6867
The following query constructs a three-dimensional vector with `INTEGER` values.
69-
It returns the `VECTOR` itself, and the xref:functions/scalar.adoc#functions-valuetype[`valueType()`] function is used to return information about its type.
7068

7169
.Construct a `VECTOR` value
7270
[source, cypher]
@@ -76,15 +74,40 @@ RETURN vector, valueType(vector) AS vectorType
7674
----
7775

7876
.Result
79-
[role="queryresult",options="header,footer",cols="2*<m"]
77+
[role="queryresult",options="header,footer",cols="1*<m"]
8078
|===
81-
| vector | vectorType
79+
| vector
8280

83-
| [1, 2, 3] | "VECTOR<INTEGER NOT NULL>(3) NOT NULL"
81+
| vector([1, 2, 3], 3, INTEGER NOT NULL)
8482

85-
2+d|Rows: 1
83+
1+d|Rows: 1
8684
|===
8785

86+
[IMPORTANT]
87+
====
88+
If you try to return a `VECTOR` value using a link:{neo4j-docs-base-uri}/create-applications/[driver] on a version older than 6.0, the `VECTOR` value will be replaced by a placeholder `MAP` value.
89+
A warning will also be attached.
90+
91+
.Returning a `VECTOR` value with a driver older than 6.0
92+
[source, cypher, role=test-skip]
93+
----
94+
CREATE (n:Label {prop: vector([0], 1, INTEGER64)})
95+
RETURN n.prop
96+
----
97+
98+
.Result
99+
[source, "queryresult"]
100+
----
101+
+----------------------------------------------------------------+
102+
| n.prop |
103+
+----------------------------------------------------------------+
104+
| {originalType: "VECTOR(1, INTEGER64)", reason: "UNKNOWN_TYPE"} |
105+
+----------------------------------------------------------------+
106+
warn: One or more values returned could not be handled by this version of the driver and were replaced with placeholder map values. Please upgrade your driver!
107+
03N95 (Neo.ClientNotification.UnknownType)
108+
----
109+
====
110+
88111
The following example uses a parameter containing a `LIST<INTEGER>` as input to `vectorValue`.
89112

90113
.Parameters
@@ -99,17 +122,17 @@ The following example uses a parameter containing a `LIST<INTEGER>` as input to
99122
[source, cypher]
100123
----
101124
WITH vector($integerList, 5, INTEGER8) as vector
102-
RETURN vector, valueType(vector) AS vectorType
125+
RETURN vector
103126
----
104127

105128
.Result
106-
[role="queryresult",options="header,footer",cols="2*<m"]
129+
[role="queryresult",options="header,footer",cols="1*<m"]
107130
|===
108-
| vector | vectorType
131+
| vector
109132

110-
| [1, 2, 3, 4, 5] | "VECTOR<INTEGER8 NOT NULL>(5) NOT NULL"
133+
| vector([1, 2, 3, 4, 5], 5, INTEGER8 NOT NULL)
111134

112-
2+d|Rows: 1
135+
1+d|Rows: 1
113136
|===
114137

115138
[role=label--enterprise-edition]
@@ -133,7 +156,7 @@ RETURN n.vectorProp AS vectorProp
133156
|===
134157
| vectorProp
135158

136-
|
159+
| vector([1, 2, 3], 3, INTEGER NOT NULL)
137160

138161
1+d|Rows: 1
139162
|===
@@ -159,7 +182,7 @@ RETURN n.vectorProp AS vectorProp
159182
|===
160183
| vectorProp
161184

162-
|
185+
| vector([1.3, 2.4, 3.1, 4.4, 5.9], 5, FLOAT NOT NULL)
163186

164187
1+d|Rows: 1
165188
|===

0 commit comments

Comments
 (0)