It's the same when I try to open the index with luke -----Original Message----- From: Erick Erickson [mailto:[EMAIL PROTECTED] Sent: 01 August 2006 15:24 To: java-user@lucene.apache.org Subject: Re: FileNotFoundException
two things come to mind.... 1> are you absolutely sure that your reader and writer are pointing to the same place? Really, absolutely, positively sure? You've hard-coded the path into both writer and reader just to be really, absolutely positively sure? Or, you could let the writer close and *then* try the reader to see if it's a timing issue or a path issue. 2> You say that the indexer is still open. Is there any chance it hasn't yet written anything to disk? I'm not sure of the internals, but there has been some discussion that internally a writer uses a RAMdir for a while then periodically flushes the results to disk. It's possible that you're writer hasn't written anything yet..... 3> (so I can't count). Have you used Luke to open your index to see if that works (and the file is in the place you expect)? FWIW Erick On 8/1/06, WATHELET Thomas <[EMAIL PROTECTED]> wrote: > > 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] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]