Lucene : rebuilding the index

Z

Zouplaz

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
 
C

Chris Smith

Zouplaz said:
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.

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.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
E

E.J. Pitt

Zouplaz said:
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.

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.
 
Z

Zouplaz

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.

Thank you... I'll will try !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top