Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 69261 invoked from network); 4 May 2006 00:26:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 May 2006 00:26:46 -0000 Received: (qmail 86142 invoked by uid 500); 4 May 2006 00:26:42 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 85709 invoked by uid 500); 4 May 2006 00:26:40 -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 85698 invoked by uid 99); 4 May 2006 00:26:40 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 May 2006 17:26:40 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [150.203.2.43] (HELO anumail3.anu.edu.au) (150.203.2.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 May 2006 17:26:39 -0700 Received: from smtphost.anu.edu.au (ds1.anu.edu.au [130.56.64.53]) by anumail3.anu.edu.au (8.13.6/8.13.6) with ESMTP id k440QD6o019204 for ; Thu, 4 May 2006 10:26:15 +1000 (EST) Received: from cairo.anu.edu.au (cairo.anu.edu.au [150.203.224.11]) by smtphost.anu.edu.au (8.13.6/8.13.6) with ESMTP id k440ABlH007087 for ; Thu, 4 May 2006 10:10:11 +1000 (EST) Received: from assda220.anu.edu.au (assda220.anu.edu.au [150.203.11.220]) by cairo.anu.edu.au (8.13.6/8.13.6) with ESMTP id k440ABJS018419 for ; Thu, 4 May 2006 10:10:11 +1000 (EST) Message-Id: <6.2.1.2.0.20060504095949.01d2f6b8@mail.coombs.anu.edu.au> X-Mailer: QUALCOMM Windows Eudora Version 6.2.1.2 Date: Thu, 04 May 2006 10:11:22 +1000 To: java-user@lucene.apache.org From: Stephen Gray Subject: Re: Updating index if there is a database changes In-Reply-To: <20060503072049.98B6810FB015@asf.osuosl.org> References: <200605021829.40754.mail@jasoncalabrese.com> <20060503072049.98B6810FB015@asf.osuosl.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=====================_1583984==.ALT" X-PMX-Version: 4.7.1.128075, Antispam-Engine: 2.3.0.1, Antispam-Data: 2006.5.3.165109 internal X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --=====================_1583984==.ALT Content-Type: text/plain; charset="us-ascii"; format=flowed Hi Kirin, Once you've updated an index using IndexWriter or IndexReader you just need to close and re-open your IndexSearcher so that searching includes the changes. There is a great library callled LuceIndexAccessor at the link below that manages this for you. It creates an IndexReader/Writer/Searcher and hands out references to classes that need to use them. When you want to read/write you just get a reference to the appropriate object from the index accessor, then release it when you've finished. If you make changes using an IndexWriter then release the reference, it waits until all IndexSearcher refs have been released, then recreates the searcher automatically. The link is: http://www.nabble.com/Fwd%3A-Contribution%3A-LuceneIndexAccessor-t17416.html#a47049 You might also like to look at DelayCloseIndexSearcher at http://issues.apache.org/jira/browse/LUCENE-445 Regards, Steve At 05:31 PM 3/05/2006, you wrote: >Hi all, > >I m working on a project where I will use lucene to make a search engine on >a database. I am new to lucene. I wrote a test program which indexes a table >and searches the same.. but now I m stuck on how to update the index in case >a database change occurs.. I need some help on this topic...like how do I >update the index at run time... can it be done then and there...or do I have >to write some kind of schedular program which "re-builds" the entire index >say once in a day ... which will be more efficient ? > >the data will be huge... 4 million records something.. > >Thanks in advance, >--Kiran > > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >For additional commands, e-mail: java-user-help@lucene.apache.org Stephen Gray Archive Research Officer Australian Social Science Data Archive 18 Balmain Crescent (Building #66) The Australian National University Canberra ACT 0200 Phone +61 2 6125 2185 Fax +61 2 6125 0627 Web http://assda.anu.edu.au/ --=====================_1583984==.ALT--