私は py2neo 1.6.4 と neo4j 2.0.1 を使用していますが、インデックス付きノードにアクセスする際に奇妙な点を見つけています。特に、index によってアクセスされるインデックス付きノードは、id によってアクセスされるノードと同じオブジェクトを返しません。
例えば:
>>> graph_db.get_or_create_indexed_node('index','key',1)
Node('http://localhost:7474/db/data/node/1')
>>> graph_db.get_indexed_node('index','key',1)
Node('http://localhost:7474/db/data/node/1') #get works fine after create
>>> graph_db.get_indexed_node('index','key',1).exists
True #the node exists in the db
>>> graph_db.get_indexed_node('index','key',1)._id
1 #the id for the node
>>> graph_db.node(1)
Node('http://localhost:7474/db/node/ #note that this is different than the query on the index
>>> graph_db.node(1).exists
False #node does not exist in db when accessed by id
そのため、返された ID がインデックス ノードに割り当てられたものとまったく同じであっても、ID によってアクセスされたときに返されたノードは実際にはデータベースに存在しません。
私はneo4jとpy2neoの両方にかなり慣れておらず、インデックス作成について圧倒的に洗練された理解を持っていません.同様に知っている:)
ありがとう!