Hi,

it is very easy to provoke the errrors you describe
when you are opening many alternating writers and 
readers on Windows.

You can circumvent this problem by using fewer
writer and reader objects, e.g., first delete
all documents to update, then write all the
updated documents. Or use a second index
only for the writing and merge this into the first
after you have deleted the update documents
there.

Regards,

Karsten



-----Ursprüngliche Nachricht-----
Von: Wilton, Reece [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 27. August 2003 23:18
An: Lucene Users List
Betreff: Exceptions while Updating an Index


Hi,

I am getting exceptions because Lucene can't rename files.  Here are a couple of the 
exceptions that I'm getting:
 - java.io.IOException: couldn't rename _6lr.tmp to _6lr.del
 - java.io.IOException: couldn't rename segments.new to segments

I am able to index many documents successfully on my Windows machine. The problem 
occurs for me during the updating process.  My updating process goes like this:

  for (each xml file i want to index) {
    // create new document
    parse the xml file
    populate a new Lucene document with the fields from my XML file

    // remove old document from index
    open an index reader
    delete the term from the index   // this successfully deletes the
one document
    close the index reader

    // add new document to index
    open an index writer
    add the document to the index writer
    close the index writer
  }
   
Any ideas on how to stop these exceptions from occuring?  No other process is reading 
or writing to the index while this process is running.

Thanks,
Reece

---------------------------------------------------------------------
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]

Reply via email to