假设我有两个节点,一条边为:
country ---> has ---> school
其中,边缘“has”具有名为“ since ”的属性。
如果我为节点和边 + 边属性创建了查找索引。
g.createKeyIndex('country', Vertex.class)
g.createKeyIndex('school', Vertex.class)
g.createKeyIndex('has', Edge.class)
如何在边缘属性上创建索引(因为)。或者在边缘“有”中创建索引时。属性被索引。是吗 ?
在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
但我不想通过这个属性文件创建自动索引,但在添加顶点/边之前需要以 gremlin 方式。
就像泰坦的方式:
g.makeType().name('since').dataType(Date.class).unique(OUT).makePropertyKey()
怎么可能通过简单的 neo4j + gremlin 呢?
我正在关注:
http://www.tinkerpop.com/docs/javadocs/blueprints/2.1.0/com/tinkerpop/blueprints/KeyIndexableGraph.html#createKeyIndex(java.lang.String , java.lang.Class)