Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 25298 invoked from network); 5 Dec 2001 08:32:03 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 5 Dec 2001 08:32:03 -0000 Received: (qmail 8480 invoked by uid 97); 5 Dec 2001 08:32:14 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@jakarta.apache.org Received: (qmail 8464 invoked by uid 97); 5 Dec 2001 08:32:14 -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 8453 invoked from network); 5 Dec 2001 08:32:13 -0000 Mime-Version: 1.0 X-Sender: ykingma@pop.xs4all.nl Message-Id: In-Reply-To: <20011204164553.25523.qmail@web12706.mail.yahoo.com> References: <20011204164553.25523.qmail@web12706.mail.yahoo.com> Date: Wed, 5 Dec 2001 09:38:57 +0100 To: "Lucene Users List" From: Ype Kingma Subject: Re: existing or not existing Content-Type: text/plain; charset="us-ascii" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Otis, >You could try looking for a segments file in the index directory. >If it exists, the index exists, else it does not. > >Is there a better way? Simply create an indexreader and catch the IOException to handle the non existing case. Ype. >Otis > >--- jean-christian.gagne@prasahewitt.ch wrote: >> >> >> Hi there, >> >> I'm testing Lucene after reading a good article on it on JavaWorld. >> >> Lucene seems quite simple and very powerful, but there's something I >> can't get. >> The first time an application uses an index, this one doesn't exist >> yet, so the >> boolean argument of the IndexWriter constructor must be true >> (creating a new >> empty index). Next time the same app is started, I want to use the >> existing >> index, the boolean argument must be false. Here is my question : how >> do I know >> wether the index exists or not ?? Is there a way to create an >> IndexWriter on a >> given index, creating it only if needed ? >> >> It seems like a stupid question, I must have missed something... >> >> Thanks >> >> >> JCG >> >> >> >> -- >> To unsubscribe, e-mail: >> >> For additional commands, e-mail: >> >> > > >__________________________________________________ >Do You Yahoo!? >Buy the perfect holiday gifts at Yahoo! Shopping. >http://shopping.yahoo.com > >-- >To unsubscribe, e-mail: >For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: