lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karsten Konrad" <>
Subject AW: Exceptions while Updating an Index
Date Thu, 28 Aug 2003 07:12:50 GMT


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



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


I am getting exceptions because Lucene can't rename files.  Here are a couple of the exceptions
that I'm getting:
 - couldn't rename _6lr.tmp to _6lr.del
 - couldn't rename 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.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message