I should say not exactly, the temporary solution I made is that, I always copy the existing index to different directory run the modification or optimization task and then copy back, somethign like flip flop mechanism..

current index <-- searcher
copy to --> temp index <-- run optimization
temp index <-- switch searcher, so searcher pomits to temtp index
copy back --> current index <-- swicth back the searcher  again

This is somehow the critical issue and there is some promise in lucene saying that the locking mechanism will be much more sophisticated in future release.

Thanks,
supriya

WATHELET Thomas wrote:
Have you solved thisproblem?
-----Original Message-----
From: Supriya Kumar Shyamal [mailto:[EMAIL PROTECTED] Sent: 01 August 2006 16:30
To: java-user@lucene.apache.org
Subject: Re: FileNotFoundException

I think its a directory access synchronisation problem, I have also posted about this before. The scenario can be like this ..

When Indexwriter object is created it reads the segment information from the file "segments" which nothing but list of files with .cfs or mayn more type, at teh same time IndexSearcher object is created which also make a list of index files from segements file, then you invoke the some write operation which triggers the index pemrging, fragmenting etc started haoppening and it modifies the file list in the segments file, but still we have the IndexerSearcher object with old file list and probably that throws the FileNotFoundExcpetion becuase physically the file is not there.

May be I am wrong but I try to put some light on this issue.

I posted the similar problem with subject "FileNotFoundException: occurs during the optimization of index", I am also experiencing the similar problem when the index optimization task runs on the index and parallally search function is also running.

thx,
supriya

WATHELET Thomas wrote:
I'm sure that it's the good location.
When the index process is finished then I can access the index.
I know why but I don't know how to solve it.
When I indexing a lot of file with the extension cfs are created and
after few second the file are merge in an other file
ex:
I have a file with this name _8df.cfs and after few second this file
disappeared (because it merged with an other file with a new name) so
the IndexSearcher can't find it.

-----Original Message-----
From: Erick Erickson [mailto:[EMAIL PROTECTED] Sent: 01 August 2006 15:49
To: java-user@lucene.apache.org
Subject: Re: FileNotFoundException

So it sounds like you're not writing the index to the place you think
you
are. Have you just looked in the directories and checked that there are
files there? If Luke can't find them, they're not where you think they
are.
Especially if your writer had closed before you looked.

Erick

On 8/1/06, WATHELET Thomas <[EMAIL PROTECTED]> wrote:
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







--
Mit freundlichen Grüßen / Regards

Supriya Kumar Shyamal

Software Developer
tel +49 (30) 443 50 99 -22
fax +49 (30) 443 50 99 -99
email [EMAIL PROTECTED]
___________________________
artnology GmbH
Milastr. 4
10437 Berlin
___________________________

http://www.artnology.com
__________________________________________________________________________

News / Aktuelle Projekte:
* artnology gewinnt Ausschreibung des Bundesministeriums des Innern:
  Softwarelösung für die Verwaltung der Sammlung zeitgenössischer
  Kunstwerke zur kulturellen Repräsentation des Bundes.

Projektreferenzen:
* Globaler eShop und Corporate-Site für Springer: www.springeronline.com
* E-Detailing-Portal für Novartis: www.interaktiv.novartis.de
* Service-Center-Plattform für Biogen: www.ms-life.de
* eCRM-System für Grünenthal: www.gruenenthal.com

___________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to