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:
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>).
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?