讓我們說我有兩個節點用一個邊緣爲:如何在邊緣屬性上創建查找索引?
country ---> has ---> school
其中,邊緣「也」呼籲財產「因爲」。
如果我爲節點和邊+邊屬性創建了查找索引。
g.createKeyIndex('country', Vertex.class)
g.createKeyIndex('school', Vertex.class)
g.createKeyIndex('has', Edge.class)
如何在edge屬性(since)上創建索引。或在邊緣「has」中創建索引時。屬性得到索引。是嗎 ?
在Neo4j.property我設置爲:
# Autoindexing
# Enable auto-indexing for nodes, default is false
node_auto_indexing=true
# The node property keys to be auto-indexed, if enabled
node_keys_indexable=country, school
# Enable auto-indexing for relationships, default is false
relationship_auto_indexing=true
# The relationship property keys to be auto-indexed, if enabled
relationship_keys_indexable=since
,但我不希望通過此屬性文件來創建自動索引,但增加的頂點/邊之前需要小鬼方式。
像泰坦方式:
g.makeType().name('since').dataType(Date.class).unique(OUT).makePropertyKey()
怎能有可能通過簡單的Neo4j +小鬼?
上午以下:
http://www.tinkerpop.com/docs/javadocs/blueprints/2.1.0/com/tinkerpop/blueprints/KeyIndexableGraph.html#createKeyIndex(java.lang.String,java.lang.Class中)