2011/7/18 sulabh choudhury <sula...@gmail.com> > Though when I think about it, I guess I would still have the issue of > getting duplicate nodes. > > Say I have 1 million node1, node2, rel entries to put in Neo, > What you are suggesting is that I do a Batch of all sets of node1,node2 > first and then flush and go about inserting all rels in the next batch > insert > Since I can have duplicate nodes in the 1million entries, how do I make > sure that all the nodes within a Batch insert are unique? > > Do I maintain another index within a batch insert (say a > hahmap) which would have entries of node and its indices, or is there a > better way ? > > If the dataset is small enough you could have it in a HashMap, but otherwise you could run that set through some pre-processing before inserting which removes duplicates... I think that would be the best alternative.
> > On Mon, Jul 18, 2011 at 11:39 AM, sulabh choudhury <sula...@gmail.com>wrote: > >> Makes sense. Will try that. >> Thanks. >> >> >> On Fri, Jul 15, 2011 at 2:59 PM, sulabh choudhury <sula...@gmail.com>wrote: >> >>> Well while inserting the nodes I keep a >>> check batchInserter.nodeExists(node1) so I would guess a node would not be >>> duplicated. >>> Otherwise during a traversal I guess duplicate nodes. IIs there a way I >>> can look into the BtachInsert data before I flush so that I can make sure no >>> duplicate data has been inserted ? >>> >>> On Sat, Jun 25, 2011 at 10:49 AM, sulabh choudhury <sula...@gmail.com>wrote: >>> >>>> Thank you Jim. >>>> I will wait for 1.5 and hope it resolves the issue :) >>>> >>>> >>>> On Fri, Jun 24, 2011 at 7:11 PM, sulabh choudhury <sula...@gmail.com>wrote: >>>> >>>>> Hi, >>>>> >>>>> I just downloaded the neo4j-community-1.4.M04. I stumbled into the >>>>> java.util.NoSuchElementException: More than one element in >>>>> org.neo4j.index.impl.lucene.LuceneIndex$1@396cbd97. First element is >>>>> 'Node[3]' and the second element is 'Node[2]' >>>>> at >>>>> org.neo4j.helpers.collection.IteratorUtil.singleOrNull(IteratorUtil.java:114) >>>>> ~[working_graphGen.jar:na] >>>>> at >>>>> org.neo4j.index.impl.lucene.IdToEntityIterator.getSingle(IdToEntityIterator.java:88) >>>>> ~[working_graphGen.jar:na] >>>>> at >>>>> org.neo4j.index.impl.lucene.IdToEntityIterator.getSingle(IdToEntityIterator.java:32) >>>>> ~[working_graphGen.jar:na] >>>>> >>>>> I looked up and found that this is a bug and has been fixed. I was >>>>> wondering if the fix has been incorporated in the latest Milestone or not? >>>>> >>>> >>>> >>>> >>>> -- >>>> >>>> -- >>>> Thanks and Regards, >>>> Sulabh Choudhury >>>> >>>> >>> >>> >>> -- >>> >>> -- >>> Thanks and Regards, >>> Sulabh Choudhury >>> >>> >> >> >> > > > -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user