Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions modules/ROOT/pages/tools/neo4j-admin/neo4j-admin-import.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ These are some things you need to keep in mind when creating your input files:
====
Indexes and constraints are not created during the import.
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]).

Starting from Neo4j 5.24, you can use the `--schema` option to create indexes and contraints during the import process.
See <<indexes-constraints-import, Provide indexes and constraints during import>> for more information.
====

[[import-tool-full]]
Expand All @@ -85,6 +88,7 @@ neo4j-admin database import full [-h] [--expand-commands] [--verbose] [--auto-sk
[--bad-tolerance=<num>] [--delimiter=<char>] [--format=<format>]
[--high-parallel-io=on|off|auto] [--id-type=string|integer|actual]
[--input-encoding=<character-set>] [--max-off-heap-memory=<size>] [--quote=<char>]
[--schema=<path>]
[--read-buffer-size=<size>] [--report-file=<path>] [--threads=<num>] --nodes=[<label>[:
<label>]...=]<files>... [--nodes=[<label>[:<label>]...=]<files>...]...
[--relationships=[<type>=]<files>...]... <database>
Expand Down Expand Up @@ -287,6 +291,12 @@ If you need to debug the import, it might be useful to collect the stack trace.
This is done by using the `--verbose` option.
|import.report

|--schema=<path> label:new[Introduced in 5.24] label
|File in which to store the Cypher schema commands to run as part of the data import.

For an example, see <<indexes-constraints-import, Provide indexes and constraints during import>>
|

|--skip-bad-entries-logging[=true\|false]
|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.
|false
Expand Down Expand Up @@ -416,6 +426,39 @@ bin/neo4j-admin database import full --nodes import/movies_header.csv,import/mov
--relationships import/roles_header.csv,import/roles.csv
----

[[indexes-constraints-import]]
==== Provide indexes and constraints during import

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.
It currently only works for full import.

You should have a Cypher script containing only `CREATE INDEX|CONSTRAINT` commands to be parsed and executed.
This file uses ';' as the separator.

For example:

[source, cypher, role=nocopy]
----
CREATE INDEX PersonNameIndex FOR (i:Person) ON (i.name);
CREATE CONSTRAINT PersonAgeConstraint FOR (c:Person) REQUIRE c.age IS :: INTEGER
----

List of supported indexes and constraints that can be created by the import tool:

* RANGE
* LOOKUP
* POINT
* TEXT
* FULL-TEXT
* VECTOR

For example:

[source, shell, role=noplay]
----
bin/neo4j-admin database import full neo4j --nodes=import/movies.csv --nodes=import/actors.csv --relationships=import/roles.csv --schema=import/schema.cypher
----


[[import-tool-multiple-input-files-regex-example]]
==== Import data from CSV files using regular expression
Expand Down