Hi Nicolas,

> I'm using Lucene.net 2.0.0 and my index file is on shared directory.
I think this is the bug in SimpleFSLockFactory  in Lucene.Net 2.0.0
See  https://issues.apache.org/jira/browse/LUCENENET-74
It is better to upgrade to 2.1

> How can I save my index?
I don't know if there is a tool to recover the index, but i can propose a
solution
1-After backup, Open the segments???????? file in binary mode (~250 byte)
2-Decrement the file# counter(it is at offset 16[4 bytes])
3-delete the entry _ov0.fnm [23 bytes]

Note: I may be wrong in offsets and lengths , so it may require some
trial&error

DIGY



-----Original Message-----
From: Nicolas OLIVERO [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 14, 2008 5:22 PM
To: [email protected]
Subject: Cannot find file _ov0.fnm 

Hi,

 

I'm using Lucene.net 2.0.0 and my index file is on shared directory.

 

All was working fine but today two users add a document at the same time.

Now when I try to search or add a document to the index I'm getting the
following error: "cannot find file _ov0.fnm".

 

How can I save my index? 

 

Maybe I'm doing something wrong in my code; do I have to put a lock when I
add a document to the index (as my index is on a shared directory)?

 

 

Dim writer As IndexWriter

Dim champ As Field

 

Try

writer = New IndexWriter(REPERTOIRE_INDEX_FULLTEXT, New
Standard.StandardAnalyzer(), False)

 

      Dim leDocument As Document = New Document()

 

      leDocument.Add(New Field("re_id", dossier.entite.getID,
Field.Store.YES, Field.Index.NO))

      leDocument.Add(New Field("rp_td_id", CStr(dossier.typedoc.rp_td_id),
Field.Store.YES, Field.Index.NO))

      leDocument.Add(New Field("contenu", contenuDocument, Field.Store.YES,
Field.Index.TOKENIZED))

 

      Try

      writer.AddDocument(leDocument)

            '' at least on windows, some temporary files raise this
exception with an "access denied" message

            '' checking if the file can be read doesn't help

            Catch ex As FileNotFoundException

 

      End Try

      

writer.Optimize()

      writer.Close()

 

     Catch ex As IOException

         The error occurs here ------ >   MessageBox.Show("L'index Fulltext
n'existe pas ou est corrompu. Reconstruisez l'index. " + ex.Message, "Erreur
index", MessageBoxButtons.OK, MessageBoxIcon.Error)

            Return False

        Catch ex As Exception

MessageBox.Show("Erreur lors de l'indexation du document car : " +
ex.Message, "Insertion impossible", MessageBoxButtons.OK,
MessageBoxIcon.Error)

            End If

            Return False

        End Try

 

 

 

Thanks for your help,

Nicolas

 


Reply via email to