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); ... Code For searching: MultiSearcher multisearch = new MultiSearcher(indexsearcher); Hits hits = this.multisearch.search(this.getBoolQuery()); ... -----Original Message----- From: Michael McCandless [mailto:[EMAIL PROTECTED] Sent: 01 August 2006 13:45 To: java-user@lucene.apache.org Subject: Re: FileNotFoundException > When the indexing process still running on a index and I try to search > something on this index I retrive this error message: > java.io.FileNotFoundException: > \\tradluxstmp01\JavaIndex\tra\index_EN\_2hea.fnm (The system cannot find > the file specified) > > How can I solve this. Could you provide some more context about your application or a small test case that shows the error happening? This sounds likely to be a locking issue. Mike --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]