Hi Wenhao, Its generally better to incrementally buld your index and at the same tiime. Considering by this time you'd be a little aware of implementing/using luceneAPI, here is what you could do. Open the existing index using 'createnew' set to false
*IndexWriter(Directory d, Analyzer a, boolean create) * *This way, the indexwriter would append the new documents to the existing index (as specified in the IndexWriter constructor).* * * *This way you could incrementally build the index.* *Also note, you may wish to optimize the index at times.* * * *Hope this solves your issue (and doubt).* * *-- Anshum Gupta Naukri Labs! http://ai-cafe.blogspot.com The facts expressed here belong to everybody, the opinions to me. The distinction is yours to draw............ On Tue, Nov 10, 2009 at 12:09 PM, Wenhao Xu <xuwenhao2...@gmail.com> wrote: > Hi, everybody, > I am new to Lucene and have a question about how to update my index. The > following is my situation: > 1) I create indexes for each text (or varchar) field of a relational > database; > 2) This database will be continuously inserted into by new records; and I > need to add indexes of these new records to the index; > So therefore, I just need to incrementally update my index. Should I > delete the original index an rebuild a new one? Or just update the new one? > Which method is better for my situation? > > I searched google, but I did not get a good answer. So I posted the > question here. Looking forward to your reply. > > Thanks, > W. > > > > -- > ~_~ >