Skip to content

Add indexes data importer #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all 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
32 changes: 29 additions & 3 deletions documentation/data-importer.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ Workspace guesses each datatype based on a sample of the values it found.
Always double-check this when working with unfamiliar data.
For example, Northwind's date/time columns are identified as strings, but you can edit that if you want to.
====
// TODO: properties with same name... this needs rewording for clarity.

// TODO: properties with same name... this needs rewording for clarity

== Relationships and IDs

Expand All @@ -120,7 +119,6 @@ You can also specify properites and their data types in isolation from mapping b
You can then map a column from your data file to the property in the file mapping tab.
====


=== Create the Product node

Now you just need to repeat the process you followed for `Order` and create a `Product` node from the `products.csv` file.
Expand All @@ -138,6 +136,34 @@ If you're unsure if you've followed the steps correctly so far, you can go ahead
button::Load Northwind node mapping[role=NX_IMPORT_LOAD,endpoint={northwind-subset-node-only-mapping-zip-file}]
====

== Constraints and indexes

To ensure accuracy of your data and support read performance, Data Importer automatically creates a uniqueness constraint and a corresponding index on the property you select as the node ID.
You can add further indexes in addition to the mandatory constraint and index.

Constraints and indexes have their own tab in the highlight:import/import-mapping-panel[mapping details panel].
Use the `+`-sign to add an index and then select which property to add the index on.

Data Importer generates a name for the index and the index type created is Neo4j's default index.
If you make a mistake, select the erroneous index and click the trash-can to delete it.

If you know that you are going to use a property regularly, it is good practice to add an index to it.
For example, if you doing administrative work with Northwind, you may be interested in the order dates.
See if you can add an index to the `orderDate` property that will help you with that!

[%collapsible]
.Hint
====
From the highlight:import/import-mapping-panel[mapping details panel], tap the `+` and select the `orderDate` property.
====

[NOTE]
====
Only the properties you mapped from the _Definition_ tab are available to create indexes on.
To modify the selection, you need to go back to the _Definition_ tab.
====

To learn more about indexes and constraints, see link:https://neo4j.com/docs/cypher-manual/current/indexes/[Cypher Manual -> Indexes] and link:https://neo4j.com/docs/cypher-manual/current/constraints/[Cypher Manual -> Constraints] repsectively.

== Create relationships

Expand Down