[英]Get all the nodes with same index value in neo4j by java?
How can I get all the nodes with same index value in neo4j by java? 如何通过Java获取neo4j中具有相同索引值的所有节点?
For example I have an index on name
property of nodes, and two nodes which both have name="alice"
. 例如,我在节点的name
属性上有一个索引,并且两个节点都具有name="alice"
。 I want to get both of nodes, when searching based on index, in java? 我想在基于索引的Java中获取两个节点?
Have you checked the documentation on indexing? 您是否检查过索引文件? http://docs.neo4j.org/chunked/stable/indexing.html http://docs.neo4j.org/chunked/stable/indexing.html
IndexManager index = graphDb.index();
Index<Node> idx= index.forNodes( "nodes" ); //this is the name of your index
IndexHits<Node> hits = idx.get( "name", "alice" );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.