Return-Path: Delivered-To: apmail-lucene-general-archive@www.apache.org Received: (qmail 95686 invoked from network); 18 Oct 2006 07:29:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Oct 2006 07:29:35 -0000 Received: (qmail 2475 invoked by uid 500); 18 Oct 2006 07:29:33 -0000 Delivered-To: apmail-lucene-general-archive@lucene.apache.org Received: (qmail 2466 invoked by uid 500); 18 Oct 2006 07:29:33 -0000 Mailing-List: contact general-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@lucene.apache.org Delivered-To: mailing list general@lucene.apache.org Received: (qmail 2453 invoked by uid 99); 18 Oct 2006 07:29:33 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Oct 2006 00:29:33 -0700 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of fidde.andersson@gmail.com designates 64.233.166.181 as permitted sender) Received: from [64.233.166.181] (HELO py-out-1112.google.com) (64.233.166.181) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Oct 2006 00:29:31 -0700 Received: by py-out-1112.google.com with SMTP id i49so224454pyi for ; Wed, 18 Oct 2006 00:29:10 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=RggqAgsmNdylZbcY2IoKkqhtQMuR3hCkUHH6glq8dEaG/4liLEnjF9Fa/FrKGwzlCt47kB7HmIzgBnZ7/QN3we7S0nSdGHsLfBmHZAxEGl/GnxwaFOh3bvYPk4QwgCldwsYKgxX9JW8BsVmsf7iQBEoNgxzQBFTLmXDk6GOx3tk= Received: by 10.35.78.13 with SMTP id f13mr17156378pyl; Wed, 18 Oct 2006 00:29:10 -0700 (PDT) Received: by 10.35.57.14 with HTTP; Wed, 18 Oct 2006 00:29:10 -0700 (PDT) Message-ID: Date: Wed, 18 Oct 2006 09:29:10 +0200 From: "Fredrik Andersson" To: general@lucene.apache.org Subject: Re: Unable to create lucene index In-Reply-To: <007501c6f23e$25378ed0$bc2615ac@ds.corp.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6345_8356217.1161156550681" References: <007501c6f23e$25378ed0$bc2615ac@ds.corp.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_6345_8356217.1161156550681 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline If you want to create an index, you have to supply the true as the last constructor argument to IndexWriter. The lock files use some kind of hash for their ID:s and might very well persist even if you delete the directory. So, delete new directory (if it ever was created), delete any lockfiles, change the constructor and try again. On 10/18/06, Deepa Paranjpe wrote: > > I want to create a lucene index and I use the following code : > > Analyzer analyzer = new StopAnalyzer(); > IndexWriter writer = new IndexWriter( "mydir", analyzer, false ); > > First it gives me Lock obtain timed out: error. > When I remove the lock file from /tmp and run it, it says segment file not > found. > > /segments (No such file or directory) > at java.io.RandomAccessFile.open(Native Method) > at java.io.RandomAccessFile.(RandomAccessFile.java:204) > at > org.apache.lucene.store.FSIndexInput$Descriptor.(FSDirectory.java > :430) > at org.apache.lucene.store.FSIndexInput.(FSDirectory.java > :439) > at > org.apache.lucene.store.FSDirectory.openInput(FSDirectory.java:329) > at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:45) > at > org.apache.lucene.index.IndexWriter$1.doBody(IndexWriter.java:264) > at org.apache.lucene.store.Lock$With.run(Lock.java:99) > at org.apache.lucene.index.IndexWriter.(IndexWriter.java > :259) > at org.apache.lucene.index.IndexWriter.(IndexWriter.java > :204) > at BuildIndex.main(BuildIndex.java:28) > > > > > > ------=_Part_6345_8356217.1161156550681--