问题
I have a graph with many different elements but every element has a property "ID". Now i would like to
CREATE INDEX ON :anyType(ID)
How can i trigger the index creation for any type?
回答1:
CREATE INDEX ON
takes a label, and cannot be called without the label (nor can it be called with multiple labels). So you'd have to execute this for each label type.
That is, you can't run:
CREATE INDEX(ID)
or
CREATE INDEX ON:*(ID)
You need to run:
CREATE INDEX ON:label(ID)
来源:https://stackoverflow.com/questions/36560014/neo4j-create-index-for-nodes-with-same-property