Hello, I'm new to Lucene and would to have your advice about index
rebuilding.
Whenever I try to recreate the index, I need to close the current
IndexReader (I use only one IndexReader instance for all that web
application). Without closing it first, I get messages like "unable to
delete 4.cfs file" and some others.
I've read the FAQ and the doc and nothing seems to prevent rebuiling an
index without leaving a reader opened.
What's wrong ?
Thanks
Chris Smith - 19 Oct 2005 21:16 GMT
> Hello, I'm new to Lucene and would to have your advice about index
> rebuilding.
[quoted text clipped - 6 lines]
> I've read the FAQ and the doc and nothing seems to prevent rebuiling an
> index without leaving a reader opened.
Most likely it's operating system dependent. On UNIX, you should have
no problem deleting a file that's currently open. On Windows, you will
have trouble. This is an area where it's not really possible to provide
compatible behavior, so the Java API spec leaves it undefined, only
guaranteeing that delete() will return false if, in fact, the delete
operation fails.

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
E.J. Pitt - 20 Oct 2005 10:13 GMT
> Hello, I'm new to Lucene and would to have your advice about index
> rebuilding.
[quoted text clipped - 3 lines]
> application). Without closing it first, I get messages like "unable to
> delete 4.cfs file" and some others.
There is a lucene mailing list and you should ask on that list, but from
memory (it's been two years) it is legal to rebuild a Lucene index while
someone else is reading (as long as they're not deleting), so you can
ignore the error. The file will get deleted later on.
Zouplaz - 23 Oct 2005 19:55 GMT
"E.J. Pitt" <esmond.not.pitt@not.bigpond.com> wrote in news:RdJ5f.23174
$U51.12946@news-server.bigpond.net.au:
>> Hello, I'm new to Lucene and would to have your advice about index
>> rebuilding.
[quoted text clipped - 8 lines]
> someone else is reading (as long as they're not deleting), so you can
> ignore the error. The file will get deleted later on.
Thank you... I'll will try !