Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 41163 invoked from network); 1 Aug 2006 17:20:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Aug 2006 17:20:59 -0000 Received: (qmail 54801 invoked by uid 500); 1 Aug 2006 17:20:48 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 54771 invoked by uid 500); 1 Aug 2006 17:20:48 -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 54726 invoked by uid 99); 1 Aug 2006 17:20:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 10:20:48 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [66.111.4.26] (HELO out2.smtp.messagingengine.com) (66.111.4.26) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 10:20:46 -0700 Received: from frontend3.internal (frontend3.internal [10.202.2.152]) by frontend1.messagingengine.com (Postfix) with ESMTP id 4D266D93063 for ; Tue, 1 Aug 2006 13:20:24 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by frontend3.internal (MEProxy); Tue, 01 Aug 2006 13:20:28 -0400 X-Sasl-enc: cXsOvNGaUzf/TWoJX/4VCDWtbeJrA6leXwL1qiA2hpdR 1154452826 Received: from [10.17.4.3] (pool-72-70-33-84.bstnma.fios.verizon.net [72.70.33.84]) by mail.messagingengine.com (Postfix) with ESMTP id BB4C42310 for ; Tue, 1 Aug 2006 13:20:26 -0400 (EDT) Message-ID: <44CF8D54.1030106@mikemccandless.com> Date: Tue, 01 Aug 2006 13:20:20 -0400 From: Michael McCandless User-Agent: Thunderbird 1.5.0.5 (X11/20060719) MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: FileNotFoundException References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N > For the index process I use IndexModifier class. > That happens when I try to search something into the index in the same > time that the index process still running. > > the code for indexing: > System.setProperty("org.apache.lucene.lockDir", System > .getProperty("user.dir")); > File folder = new File(getIndexPath()); > Directory dir = null; > if (folder.isDirectory() && folder.exists()) { > dir = FSDirectory.getDirectory(getIndexPath(), false); > } else if (!folder.isFile() && !folder.exists()) { > dir = FSDirectory.getDirectory(getIndexPath(), true); > } else { > System.out.println("Bad index folder"); > System.exit(1); > } > boolean newIndex = true; > if (dir.fileExists("segments")) { > newIndex = false; > } > // long lastindexation = dir.fileModified("segments"); > writer = new IndexModifier(dir, new SimpleAnalyzer(), newIndex); > dir.close(); > writer.setUseCompoundFile(true); > ... BTW, one thing that I don't think is right is the "dir.close()" statement after you creat the IndexModifier. I think you should not call dir.close() until you are done with the IndexModifier (ie, at the same time you call IndexModifier.close()). It sounds like it's unrelated to your NFS locking issue but still could cause other problems... Mike --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org