lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "WATHELET Thomas" <thomas.wathe...@europarl.europa.eu>
Subject RE: FileNotFoundException
Date Tue, 01 Aug 2006 12:32:47 GMT
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:lucene@mikemccandless.com] 
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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message