Relationship Labels and Index in Neo4J

前端 未结 1 1160
时光取名叫无心
时光取名叫无心 2020-12-10 04:17

It\'s possible to label the nodes in the new Neo4J 2.0.1, but does that same labelling work on relationships? If I have a relationship of the type :TO, can I create an index

相关标签:
1条回答
  • 2020-12-10 05:09

    a) you cannot have labels on relationships. A relationship has one type (which can be thought of kind of label). If you need multiple labels, you just create multiple relationships with different types

    b) schema indexes on relationships are not possible. A graph query typically starts at nodes and not at relationships since nodes are the "things" in your domain. Starting at a relationship is IMHO often a indication to rethink your graph model. If you're still convinced you need relationship indexing, you can go with legacy indexing.

    0 讨论(0)
提交回复
热议问题