简体   繁体   中英

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?

For example I have an index on name property of nodes, and two nodes which both have name="alice" . I want to get both of nodes, when searching based on index, in java?

Have you checked the documentation on indexing? 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" );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM