Neo4j: Create index for nodes with same property

荒凉一梦 提交于 2019-12-10 17:24:51

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!