> I've never used Lucene on windows, but if I recall correctly from past > discussions on this topic, the IndexWriter will try to delete any file > listed in deletable whenever it does any segment merging (ie: after adding > some number of documents, when you call .optimize(), or when you call > .close().
You are correct. Calling addDocument() removes unnecessary files and makes size of deletable 4. Thank you, Koji > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Chris Hostetter > Sent: Sunday, October 16, 2005 3:42 PM > To: java-user@lucene.apache.org > Subject: RE: delete unnecessary files after optimize() > > > > : > How can I get a list of unnecessary files to delete them? > : > : I can get such information from deletable file under Win32 environment, > : correct? > > I've never used Lucene on windows, but if I recall correctly from past > discussions on this topic, the IndexWriter will try to delete any file > listed in deletable whenever it does any segment merging (ie: after adding > some number of documents, when you call .optimize(), or when you call > .close(). > > the only reason those files won't be deleted is if some IndexReader has > them open -- in which cas you won't be able to delete them either, so > don't worry about it. The safest thing to do is make sure you > periodically reopen new IndexReaders, and if you're really in a hurry to > get rid of those files, periodically open/close a new IndexWriter too > (even if you don't need one) ... that should cause it to try to delete the > files again. > > > : > -----Original Message----- > : > From: Koji Sekiguchi [mailto:[EMAIL PROTECTED] > : > Sent: Sunday, October 16, 2005 11:05 AM > : > To: java-user@lucene.apache.org > : > Subject: delete unnecessary files after optimize() > : > > : > > : > Hello, > : > > : > My Tomcat application has several threads. These threads > : > share a single instance of IndexSearcher to seach contents. > : > > : > At some point in time, I have the following index directory: > : > > : > -rwx------+ 1 admin admin 158622 Oct 16 10:21 _1pp.cfs > : > -rwx------+ 1 admin admin 158622 Oct 16 10:21 _2kk.cfs > : > -rwx------+ 1 admin admin 158622 Oct 16 10:21 _3ff.cfs > : > -rwx------+ 1 admin admin 158622 Oct 16 10:21 _4aa.cfs > : > -rwx------+ 1 admin admin 158614 Oct 16 10:20 _uu.cfs > : > -rwx------+ 1 admin admin 4 Oct 16 10:21 deletable > : > -rwx------+ 1 admin admin 64 Oct 16 10:21 segments > : > > : > In this moment, I want to optimize() the index. I can do it safely > : > without interrupting Tomcat process. > : > After optimizing the index, I get a new compounf file _4ab.cfs: > : > > : > -rwx------+ 1 admin admin 158622 Oct 16 10:21 _1pp.cfs > : > -rwx------+ 1 admin admin 158622 Oct 16 10:21 _2kk.cfs > : > -rwx------+ 1 admin admin 158622 Oct 16 10:21 _3ff.cfs > : > -rwx------+ 1 admin admin 158622 Oct 16 10:21 _4aa.cfs > : > -rwx------+ 1 admin admin 791622 Oct 16 10:21 _4ab.cfs > : > -rwx------+ 1 admin admin 158614 Oct 16 10:20 _uu.cfs > : > -rwx------+ 1 admin admin 48 Oct 16 10:21 deletable > : > -rwx------+ 1 admin admin 29 Oct 16 10:21 segments > : > > : > Now I can let threads of Tomcat know that we have a new compound > : > file so that servlet can reopen IndexSearcher to use new segments. > : > But I want to delete old and unnecessary files (_1pp, _2kk, > : > _3ff, _4aa and _uu .cfs files) after reopening IndexSearcher > : > to save disk space. > : > > : > How can I get a list of unnecessary files to delete them? > : > > : > regards, > : > > : > Koji > : > > : > > : > > : > > : > --------------------------------------------------------------------- > : > To unsubscribe, e-mail: [EMAIL PROTECTED] > : > For additional commands, e-mail: [EMAIL PROTECTED] > : > > : > > : > : > : > : --------------------------------------------------------------------- > : To unsubscribe, e-mail: [EMAIL PROTECTED] > : For additional commands, e-mail: [EMAIL PROTECTED] > : > > > > -Hoss > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]