Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Neo4j(使用Lucene索引)中,我如何找到一个节点的索引?_Neo4j_Lucene_Luke - Fatal编程技术网

在Neo4j(使用Lucene索引)中,我如何找到一个节点的索引?

在Neo4j(使用Lucene索引)中,我如何找到一个节点的索引?,neo4j,lucene,luke,Neo4j,Lucene,Luke,对于给定的索引和键,我可以使用(Cypher)查找节点: 或使用(嵌入式Java): 索引=。。。。。 IndexHits hits=index.query(键,查询); 迭代器itr=hits.Iterator(); 我所寻找的是一种相反的方法;查找已为给定节点编制索引的键/值对。比如: Map<String, Object> pairs = index.getKeyValuePairs(node); Map pairs=index.getKeyValuePairs(节点);

对于给定的索引和键,我可以使用(Cypher)查找节点:

或使用(嵌入式Java):

索引=。。。。。
IndexHits hits=index.query(键,查询);
迭代器itr=hits.Iterator();
我所寻找的是一种相反的方法;查找已为给定节点编制索引的键/值对。比如:

Map<String, Object> pairs = index.getKeyValuePairs(node);
Map pairs=index.getKeyValuePairs(节点);
我能找到的唯一朝这个方向发展的工具是,但这是一个桌面Java应用程序,这使得在服务器上的索引上使用它变得很困难


我对此感兴趣的原因是因为我有一个很大的neo4j数据集,其中我错误地索引了一些节点。现在,如果不使用通配符索引查询,我就无法找到它们。通配符索引查询太不精确,需要对返回的
索引进行迭代,或者使用Cypher查询
WHERE
子句,这太慢了。

在Neo4j 1.9中,您不能。在Neo4j 2.0中,您可以获得节点上的标签和索引,例如

CREATE n:Person{name:'Jim'}
编制索引

CREATE INDEX on :Person(name)
列表标签

MATCH n
RETURN LABELS(n)

好的,就这样了。我还在1.8.2上。
CREATE INDEX on :Person(name)
MATCH n
RETURN LABELS(n)