Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-21-2022 01:50 PM
Sections 2.9 and 2.10 of the Cypher Documentation say that "A named token lookup index for all nodes with one or more labels" and "A named token lookup index for all relationships with any relationship type" can be created with the following Cypher commands:
CREATE LOOKUP INDEX node_label_lookup_index FOR (n) ON EACH labels(n)
CREATE LOOKUP INDEX rel_type_lookup_index FOR ()-[r]-() ON EACH type(r)
I'm running neo4j-enterprise v4.4.4. I have created a brand-new database, and when I run "SHOW INDEXES", I get the following:
"index_343aff4e" "ONLINE" 100.0 "NONUNIQUE" "LOOKUP" "NODE" null null "token-lookup-1.0"
"index_f7700477" "ONLINE" 100.0 "NONUNIQUE" "LOOKUP" "RELATIONSHIP" null null "token-lookup-1.0"
When I attempt either of the above commands, I get a complaint that an index of the given type already exists:
There already exists an index (:<any-labels>).
and
There already exists an index -[:<any-types>]-.
I intend to create the indices and constraints before populating the databases I'm about to use. I'd rather do that before a database has millions of nodes and relationships. I make heavy use of labeled nodes and relationships, and I certainly want an index on each in the populated database.
Does this mean that don't need to do anything to have and use these indices? Does this mean I should drop the existing indices on these types and labels and then run the code from the documentation?
Is this a documentation bug?
All the sessions of the conference are now available online