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
Copy file name to clipboardExpand all lines: modules/ROOT/pages/tools/neo4j-admin/neo4j-admin-import.adoc
+45-3Lines changed: 45 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,10 @@ These are some things you need to keep in mind when creating your input files:
64
64
====
65
65
Indexes and constraints are not created during the import.
66
66
Instead, you have to add these afterward (see link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/indexes-for-full-text-search[Cypher Manual -> Indexes]).
67
+
68
+
Starting from Neo4j 5.24, you can use the `--schema` option to create indexes and contraints during the import process.
69
+
The option is available in the Enterprise Edition and works only for the block format.
70
+
See <<indexes-constraints-import, Provide indexes and constraints during import>> for more information.
@@ -287,6 +291,10 @@ If you need to debug the import, it might be useful to collect the stack trace.
287
291
This is done by using the `--verbose` option.
288
292
|import.report
289
293
294
+
|--schema=<path> label:new[Introduced in 5.24] label:enterprise[Enterprise edition]
295
+
|File in which to store the Cypher schema commands to run as part of the data import.
296
+
|
297
+
290
298
|--skip-bad-entries-logging[=true\|false]
291
299
|When set to `true`, the details of bad entries are not written in the log. Disabling logging can improve performance when the data contains lots of faults. Cleaning the data before importing it is highly recommended because faults dramatically affect the tool's performance even without logging.
292
300
|false
@@ -416,6 +424,40 @@ bin/neo4j-admin database import full --nodes import/movies_header.csv,import/mov
==== Provide indexes and constraints during import
430
+
431
+
Starting with Neo4j 5.24, you can use the `--schema` option that allows Cypher commands to be provided to create indexes/constraints during the initial import process.
432
+
It currently only works for the block format and full import.
433
+
434
+
You should have a Cypher script containing only `CREATE INDEX|CONSTRAINT` commands to be parsed and executed.
435
+
This file uses ';' as the separator.
436
+
437
+
For example:
438
+
439
+
[source, cypher, role=nocopy]
440
+
----
441
+
CREATE INDEX PersonNameIndex FOR (i:Person) ON (i.name);
442
+
CREATE CONSTRAINT PersonAgeConstraint FOR (c:Person) REQUIRE c.age IS :: INTEGER
443
+
----
444
+
445
+
List of supported indexes and constraints that can be created by the import tool:
446
+
447
+
* RANGE
448
+
* LOOKUP
449
+
* POINT
450
+
* TEXT
451
+
* FULL-TEXT
452
+
* VECTOR
453
+
454
+
For example:
455
+
456
+
[source, shell, role=noplay]
457
+
----
458
+
bin/neo4j-admin database import full neo4j --nodes=import/movies.csv --nodes=import/actors.csv --relationships=import/roles.csv --schema=import/schema.cypher
0 commit comments