I tried My App with v2.9.0 without reusing Documents and it is working fine.
Based on the suggestion from group (refer attached mail), I modified the code to use v3.0.0 and in order to increase performance, I am reusing the Documents and Fields objects as suggessted. I am facing problems with this approach. Documents cannot be re-used in v3.0? Regards Ganesh ----- Original Message ----- From: "Uwe Schindler" <u...@thetaphi.de> To: <java-user@lucene.apache.org> Sent: Tuesday, February 02, 2010 1:41 PM Subject: [Bulk] RE: Exception while adding document in 3.0 > They can. > > ----- > Uwe Schindler > H.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: u...@thetaphi.de > >> -----Original Message----- >> From: Glen Newton [mailto:glen.new...@gmail.com] >> Sent: Tuesday, February 02, 2010 9:03 AM >> To: java-user@lucene.apache.org >> Subject: Re: Exception while adding document in 3.0 >> >> Documents cannot be re-used in v3.0? >> http://wiki.apache.org/lucene-java/ImproveIndexingSpeed >> >> -glen >> http://zzzoot.blogspot.com/ >> >> On 2 February 2010 02:55, Simon Willnauer >> <simon.willna...@googlemail.com> wrote: >> > Ganesh, >> > >> > do you reuse your Document instances in any way or do you create new >> > docs for each add? >> > >> > simon >> > >> > On Tue, Feb 2, 2010 at 7:18 AM, Ganesh <emailg...@yahoo.co.in> wrote: >> >> I am getting below exception, while adding documents. I am adding >> documents continously and at some point, i am getting the below >> exception. This exception is not occuring with v2.9.0 >> >> >> >> Exception: Index: 21, Size: 2 >> >> java.util.ArrayList.RangeCheck(Unknown Source) >> >> java.util.ArrayList.get(Unknown Source) >> >> >> org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(Doc >> FieldProcessorPerThread.java:175) >> >> >> org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter >> .java:779) >> >> >> org.apache.lucene.index.DocumentsWriter.addDocument(DocumentsWriter.ja >> va:757) >> >> >> org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2472) >> >> >> org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2446) >> >> >> >> Regards >> >> Ganesh >> >> Send instant messages to your online friends >> http://in.messenger.yahoo.com >> >> >> >> -------------------------------------------------------------------- >> - >> >> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org >> >> For additional commands, e-mail: java-user-h...@lucene.apache.org >> >> >> >> >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org >> > For additional commands, e-mail: java-user-h...@lucene.apache.org >> > >> > >> >> >> >> -- >> >> - >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org >> For additional commands, e-mail: java-user-h...@lucene.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org >
--- Begin Message ---There's a section on reusing Fields and Documents in http://wiki.apache.org/lucene-java/ImproveIndexingSpeed. And lots of other good tips. -- Ian. On Mon, Jan 18, 2010 at 10:05 AM, Michael McCandless <luc...@mikemccandless.com> wrote: > It should give some perf improvement, reducing GC costs. > > But you don't need to set field values to null -- just set to the > values of the next doc to index, and index with that. > > If your machine has available hardware concurrency, using threads > should give you even more gains. > > Mike > > On Mon, Jan 18, 2010 at 4:47 AM, Ganesh <emailg...@yahoo.co.in> wrote: >> Hello all, >> >> I am indexing millions of documents. The app is single threaded. I need to >> create Document and Fields objects repeatedly. I have a thought to create it >> once and reuse by setting the field values to null. >> >> Is this advisable, Will it give any performance improvement? >> >> Regards >> Ganesh >> >> >> Send instant messages to your online friends http://in.messenger.yahoo.com >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org >> For additional commands, e-mail: java-user-h...@lucene.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org
--- End Message ---
--------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org