Reputation: 519
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?
Upvotes: 0
Views: 236
Reputation: 1297
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" );
Upvotes: 1