I don't see why there should be any delay.

if you just try this, it should be able to add several thousand nodes per 
second to the graph.

GraphDatabaseService graphdb = new EmbeddedGraphDatabase("words.db");
Index<Node> index = graphdb.index().forNodes("words");

for (Document doc : documents) {
 Transaction tx=graphdb.beginTx();
  try {
     for (String word : document.words()) {
         Node node = index.get("word",word).getSingle();
         if (node == null) {
             node = graphdb.createNode();
             node.setProperty("word",word);
             node.setProperty("count",1);
             index.add(node, "word",word);
         } else {
              node.setProperty("count", (Integer)node.getProperty("count")+1);
         }
     }
     tx.success();
  } finally {
     tx.finish();
  }
}

Am 08.08.2011 um 17:06 schrieb ahmed.elsharkasy:

> Also what is the reason of the delay still?
> 
> --
> View this message in context: 
> http://neo4j-community-discussions.438527.n3.nabble.com/Batch-find-tp3221634p3235850.html
> Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
> _______________________________________________
> 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