Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 28277 invoked from network); 21 May 2003 20:26:04 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 21 May 2003 20:26:04 -0000 Received: (qmail 15435 invoked by uid 97); 21 May 2003 20:28:16 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@nagoya.betaversion.org Received: (qmail 15428 invoked from network); 21 May 2003 20:28:16 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 21 May 2003 20:28:16 -0000 Received: (qmail 28002 invoked by uid 500); 21 May 2003 20:26:01 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 27982 invoked from network); 21 May 2003 20:26:00 -0000 Received: from unknown (HELO chameleon.infoage.com.br) (200.187.133.40) by daedalus.apache.org with SMTP; 21 May 2003 20:26:00 -0000 Received: (qmail 9455 invoked from network); 21 May 2003 20:25:26 -0000 Received: from unknown (HELO ?172.16.1.42?) (200.187.133.34) by chameleon.infoage.com.br with SMTP; 21 May 2003 20:25:26 -0000 Subject: RE: Reusing an IndexWriter ? From: Guilherme Barile To: Lucene Users List In-Reply-To: <20030521192301.91422.qmail@web12701.mail.yahoo.com> References: <20030521192301.91422.qmail@web12701.mail.yahoo.com> Content-Type: text/plain Organization: Message-Id: <1053548712.9062.57.camel@gui> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.3 Date: 21 May 2003 17:25:13 -0300 Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I just finished changing my main class (which wraps lucene methods). Now I close my indexwriter every time I finish indexing, I also open/close my IndexReader and Searcher every time I search. Seem to be working. As a curiosity, how would lucene work in a multi-user environment ? (multiple users indexing information at the same time on the same index) Did anyone ever wrote an IndexWriter connection pooler ? Thanks a lot (again) gui On Wed, 2003-05-21 at 16:23, Otis Gospodnetic wrote: > --- Guilherme Barile wrote: > > But if I start both an IndexReader and an IndexWriter on the program > > startup, and add documents to the index without closing it, the > > reader > > wouldn't be able to search it, will it ? > > Correct. > > > Can anyone show me the "safe way" do to it ? > > Close the InderWriter when you are done indexing, and re-open > IndexReader/Searcher when you detect that the index changed in order to > 'see' new documents. > > Otis > > > > thanks > > > > On Wed, 2003-05-21 at 12:44, Aviran Mordo wrote: > > > You can create one instance of Container in your main application > > and > > > reuse it. Just don't forget to add a close method to it (Container) > > so > > > you can close the writer after you are done doing all the work. > > > > > > Aviran > > > > > > -----Original Message----- > > > From: Guilherme Barile [mailto:gui@prosoma.com.br] > > > Sent: Wednesday, May 21, 2003 11:20 AM > > > To: Lucene Users List > > > Subject: RE: Reusing an IndexWriter ? > > > > > > > > > Probably, but not the way I'm using it. > > > I created a Container class that wraps lucene methods, I call it > > using > > > myindex = new Container(File); where File is the directory where > > the > > > index resides. > > > > > > On Container's constructor, I create a writer and a reader, but I > > guess > > > I'll have to open a reader every time I search and a writer every > > time I > > > write to it, am I right ? > > > > > > thanks again > > > > > > gui > > > > > > On Wed, 2003-05-21 at 11:35, Aviran Mordo wrote: > > > > You can keep the IndexWriter open until you quit the indexing > > > > application. Then you'll need to close it. > > > > > > > > Aviran > > > > > > > > -----Original Message----- > > > > From: Guilherme Barile [mailto:gui@prosoma.com.br] > > > > Sent: Wednesday, May 21, 2003 9:55 AM > > > > To: Lucene > > > > Subject: Reusing an IndexWriter ? > > > > > > > > > > > > Hello > > > > I just started using Lucene, and I'm writing a simple program > > > (swing > > > > interface) that adds files to an index (I'm not searching that > > index > > > > yet). > > > > In my main frame, I click a button, a FileChooser appears and I > > > > add the contents of the chosen file to this index... now, after > > adding > > > > this document, do I have to close my IndexWriter object ? > > > > > > > > I just added a file and that's what I found on my index dir: > > > > > > > > total 4 > > > > -rw-r--r-- 1 guigouz users 8 May 21 10:49 segments > > > > -rw-r--r-- 1 guigouz users 0 May 21 10:49 > > write.lock > > > > > > > > Isn't there some method to writeout the index without closing > > > the > > > > IndexWriter ? > > > > > > > > thanks in advance > > > > > > > > gui > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: > > lucene-user-unsubscribe@jakarta.apache.org > > > > For additional commands, e-mail: > > lucene-user-help@jakarta.apache.org > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: > > lucene-user-unsubscribe@jakarta.apache.org > > > > For additional commands, e-mail: > > lucene-user-help@jakarta.apache.org > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > > > For additional commands, e-mail: > > lucene-user-help@jakarta.apache.org > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > > > For additional commands, e-mail: > > lucene-user-help@jakarta.apache.org > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: lucene-user-help@jakarta.apache.org > > > > > __________________________________ > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo. > http://search.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: lucene-user-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org