我的索引节点有以下属性:
{'user_id': u'00050714572570434939', 'hosts': [u'http://shyjive.blogspot.com/'], 'follows': ['null']}
现在我有索引,我正在尝试简单查询索引以获取节点:
index = gdb.nodes.indexes.create('blogger2')
uid = gdb.nodes.create()
uid["hosts"] = ['http://shyjive.blogspot.com/']
uid["user_id"] = "00050714572570434939"
uid["follows"] = ['null']
print index["user_id"]["00050714572570434939"][:]
这个返回[] ,这里有什么不对!!
我开始在neo4j组上建议我在python中使用list的原因是我想将多个属性值存储到节点,所以我在这里使用list而不是数组答案 0 :(得分:1)
首先需要为节点编制索引。如果您未使用automatic indexing,neo4j-rest-client的代码将为:
index["user_id"]["00050714572570434939"] = uid
现在你有:
>>> index["user_id"]["00050714572570434939"][:]
[<Neo4j Node: http://localhost:7474/db/data/node/38>]