lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Problem updating index while reader is open
Date Wed, 23 Aug 2006 11:30:32 GMT

> If I try to add documents to an index while a reader is open I get en error message saying
"Cannot delete C:\myindex\_3n.f0". I suspect that this is due to the fact that the windows
fs won't allow deletion of a file when there is a filehandler connected to it. The solution
I have at the moment is this:

You are correct: Lucene is trying to remove all previous index files
because you are doing a clean rebuild of your index.

Doing a clean rebuild (create=true on opening the IndexWriter) against
an index that's open for searching is not currently a supported use
case, and this is exactly the error you'll hit on Windows.  As a
workaround, you could do a clean build into a fresh directory and then
restart your index searchers against this fresh directory (and remove
the old one)?

However, making incremental changes to an index (adding or deleting
docs) that's open for searching is a valid use case.  You need to
ensure your locking directory (defaults to windows temp dir) is set to
the same [local, not remote NFS/Samba] directory for readers &
writers.  Since you're using a single JVM (I think?) you probably have
that already.  Are you also hitting an exception for that case?

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message