Karthik,

You can index the nodes you are interested in as start and/or end-nodes of your 
traversal and then retrieve them via the index.

// to add them
gDB.index().forNodes("indexName").add(node,"key","value");

nodeIndex.get("key","value") returns an IndexHits<Node> that you can iterate 
over or use getSingle() to retrieve a single matching node.

See also:
http://wiki.neo4j.org/content/Index_Framework

Other ways of accessing nodes in the db are getById() or traversal using the 
traversal framework 
or manual traversal starting from the reference node (gDB.getReferenceNode()) 
that you should connect your graph to.

Cheers

Michael

Am 02.02.2011 um 13:34 schrieb karthik aithal:

> Hi,
> 
>     I am biginner to Neo4j and eager to learn more about it. I am aware
> of creating new Graph database with 1k to 10k nodes and relationship and was
> successfully traverse to specific nodes. But currently I am facing difficult
> to get node from existing graph DB and traverse to specific node in that DB.
> 
> For creating new Graph DB I am using:
> 
> GraphDatabaseService gDB = new EmbeddedGraphDatabase("target/db");
> 
> So, if I have 10k nodes(with relationship) in Path: "/NeoDB/store/db" then
> how can I retrive nodes from this DB?
> 
> Thanks for your help in advance,
> 
> Karthik
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to