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
<1> xref:functions/aggregating.adoc#functions-collect[Collect] all returned `Movie` nodes into a `LIST<NODE>`.
195
195
<2> `batchSize` defines the number of nodes in `moviesList` to be processed at once.
196
196
Because vector embeddings can be very large, a larger batch size may require significantly more memory on the Neo4j server.
197
197
Too large a batch size may also exceed the provider's threshold.
198
198
<3> Process `Movie` nodes in increments of `batchSize`.
199
+
The end range `total-1` is due to `range` being inclusive on both ends.
199
200
<4> A xref:subqueries/subqueries-in-transactions.adoc[`CALL` subquery] executes a separate transaction for each batch.
200
201
Note that this `CALL` subquery uses a xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause] (introduced in Neo4j 5.23) to import variables.
201
202
If you are using an older version of Neo4j, use an xref:subqueries/call-subquery.adoc#importing-with[importing `WITH` clause] instead.
202
203
<5> `batch` is a list of strings, each being the concatenation of `title` and `plot` of one movie.
203
204
<6> The procedure sets `vector` as value for the property named `embedding` for the node at position `batchStart + index` in the `moviesList`.
204
205
<7> Set to `1` the amount of batches to be processed at once.
206
+
Concurrency in transactions was introduced in Cypher 5.21 (see xref:subqueries/subqueries-in-transactions.adoc#concurrent-transactions[`CALL` subqueries -> Concurrent transactions]).
205
207
206
208
[NOTE]
207
209
This example may not scale to larger datasets, as `collect(m)` requires the whole result set to be loaded in memory.
0 commit comments