Make sure you put the writer.close() in the finally block. This should
cover most problems you'll see.

Are you sure the index is corrupted? The most common problem I found
is Lucene leave a lock file in the temp directory if you fail to call
writer.close(). If you cannot open the index, simply delete the lock
file may get you back on track. I assume this is what
IndexReader.unlock() does. But your best bet is to ask this in the
lucene mailing list.


On Thu, 10 Feb 2005 14:57:33 -0800, Nick Arnett <[EMAIL PROTECTED]> wrote:
> I just noticed that if I create an index, don't add any documents, and fail 
> to do
> IndexWriter.close(), the index seems to be unusable.
> 
> Is this generally true?  Are indexes fairly sure to be corrupt if the process 
> is interrupted or
> otherwise ended in some unclean way?
> 
> Nick
> 
> _______________________________________________
> pylucene-dev mailing list
> [email protected]
> http://lists.osafoundation.org/mailman/listinfo/pylucene-dev
>
_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to