OK I opened this issue:
https://issues.apache.org/jira/browse/LUCENE-2259
And put a patch on. If you can try the patch, that'd be great :) You
should be able to apply the patch, build a new jar, then run your test
again unmodified, and 0.cfs, 1.cfs should then be removed.
Mike
2010/2/10 Mic
>From this test, I would expect all 3 files to be left, because
IndexWriter never gets another chance to remove the files.
IndexWriter only attempts to remove unreferenced files in roughly 3 places:
* On open
* On flushing a new segment
* On finishing a merge
So, the moment your optimize f
here a small test case I watched there are three compound files.
0.cfs6786kb
1.cfs2044kb
2.cfs8790kb(the optimize file)
I think in this testcase only 2.cfs left(the optimize file left),Is that right??
import java.io.File;
import java.io.IOException;
import org.apache.lucene.analysis.
t;
>
>
> ----- 原文 - 发件人: Michael McCandless 主 题: Re: problem:lucene did not delete
> old index file after optimize method called时 间: 2010年2月10日 17:58:12
> This happens, on Windows, when there is an IndexReader still readingthose
> files. IndexWriter will periodically (after a merge co
anted.
((after I restart my program, optimize index file disappear,but old index file
stay))
- 原文 - 发件人: Michael McCandless 主 题: Re: problem:lucene did not delete
old index file after optimize method called时 间: 2010年2月10日 17:58:12
This happens, on Windows, when there is an IndexReader
This happens, on Windows, when there is an IndexReader still reading
those files. IndexWriter will periodically (after a merge completes
or a new segment is flushed) retry deleting those files, but it won't
succeed until no reader has a given file open anymore.
IW also deletes unreferenced files