Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 77472 invoked from network); 10 Nov 2009 07:36:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Nov 2009 07:36:30 -0000 Received: (qmail 30713 invoked by uid 500); 10 Nov 2009 07:36:28 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 30628 invoked by uid 500); 10 Nov 2009 07:36:27 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 30618 invoked by uid 99); 10 Nov 2009 07:36:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2009 07:36:27 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of anshumg@gmail.com designates 209.85.222.173 as permitted sender) Received: from [209.85.222.173] (HELO mail-pz0-f173.google.com) (209.85.222.173) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2009 07:36:19 +0000 Received: by pzk3 with SMTP id 3so2540246pzk.20 for ; Mon, 09 Nov 2009 23:35:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=7PbbKYJTOXJUwHibPzCJE20ZPZkuyUMX1ikvMviJkrQ=; b=O9KBAIQVEnlX1RV+f6qRHmsBnmIfqzGf+2U/Yg0JrUk6BqvU9ruMKG2kFcWn76WG47 04iuey52ZhVRnBfVCtvniWGYMJhLo6WHkHECBFD+Fl3XKSi77EzDtSTTM6LX/nBXM8CJ y9bHgJRbXjWDltGMO/hqC0Fqe3UN2kip4P50g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=mac14x+dw68ZI79tY+bb6oTlVhOYrQFUYrVqNyAM6KBK8s5HBEtntgXFmEAEqhmCvN 5eQIBJnhLyF/vRGWOY9ZfU50afDvtywrh3Ofia4cYZEktyX7NkFhh4lL+mgptLTDZvgv 2bBPd5/NH5GfwzDjBXRhEs8Yi6oUaUPAHynOg= MIME-Version: 1.0 Received: by 10.115.80.6 with SMTP id h6mr2385318wal.108.1257838558174; Mon, 09 Nov 2009 23:35:58 -0800 (PST) In-Reply-To: References: From: Anshum Date: Tue, 10 Nov 2009 13:05:38 +0530 Message-ID: <867513fe0911092335n5448fff6xf636afaead628c9f@mail.gmail.com> Subject: Re: Index maintaining/updating To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=0016e64dc8fe71dd380477ff5c87 X-Virus-Checked: Checked by ClamAV on apache.org --0016e64dc8fe71dd380477ff5c87 Content-Type: text/plain; charset=ISO-8859-1 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 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. > > > > -- > ~_~ > --0016e64dc8fe71dd380477ff5c87--