Re: Optimizing while readers are open

2008-09-25 Thread Michael McCandless
Eran Sevi wrote: I'm using Windows and it worked just fine, although the procedure is a bit awkward. Why do I have to open a new writer? closing the current one (after switching readers) isn't enough? is it because of deleted documents that need to be updated? It's because Windows doesn'

Re: Optimizing while readers are open

2008-09-25 Thread Eran Sevi
Thanks Mike, I'm using Windows and it worked just fine, although the procedure is a bit awkward. Why do I have to open a new writer? closing the current one (after switching readers) isn't enough? is it because of deleted documents that need to be updated? Do you know if it's different in more ad

Re: Optimizing while readers are open

2008-09-25 Thread Michael McCandless
Are you on Windows? If so, you'll need to then open & close a new IndexWriter after the old reader has switched to the optimized index. That will delete the old files. On other OSs, which usually implement "delete on last close", the disk space should be automatically freed up once you

Optimizing while readers are open

2008-09-25 Thread Eran Sevi
Hi, I have the following scenario using Lucene 2.1 1. Open reader on index to perform some searches. 2. Use reader to check if index is optimized. 2. Open writer and run optimize() 3. Close old reader and open a new reader for further searches. I expected that after closing the old reader , the