[Neo4j] Batch Insertion, how to index relationships?

Pablo Pareja ppareja at era7.com
Wed Mar 2 10:43:52 CET 2011


I just checked the wiki looking for information on how to index
relationships in batch insertion mode but
didn't find anything so far.
This can be found in the wiki regarding relationship indexing:

RelationshipIndex friendships = graphDb.index().forRelationships(
"friendships" );
// "type" isn't a reserved key and isn't indexed automatically
Relationship relationship = friendships.get( "type", "knows", morpheus,
trinity ).getSingle();

However I cannot find any code snippet for adding relationships to the
index, not just querying it.
How can these two different cases (*batch insertion and standard mode*) be
carried out?

Besides that, I was wondering how node relationships retrieval is
In my domain model I have some nodes which have hundred of thousands of
relationships, including different types of them.

Suppose you are already situated on one of these nodes and you want to get
only one specific type of incoming relationships,
retrieval time would be dependent on how many relationships are there
including other types?
or once you specify the relationship type in the node.getRelationships(...)
method it doesn't matter how many relationships are there
of other types in terms of relationship retrieval time?

Thanks in advance,


Pablo Pareja Tobes
LinkedIn    http://www.linkedin.com/in/pabloparejatobes
Twitter       http://www.twitter.com/pablopareja


More information about the User mailing list