Re: How to delete old index

2007-11-26 Thread Michael McCandless
"Cool Coder" <[EMAIL PROTECTED]> wrote: > I tried with your suggestion but still it did not delete old index files. That's very odd. Are you sure you added that line after your first reader was closed & second one was opened? It's that first reader that prevents deleting of the old index files.

Re: How to delete old index

2007-11-25 Thread Cool Coder
I tried with your suggestion but still it did not delete old index files. Anyway I closed reader before closing writer and reopened reader after closing writer which deleted all old index files. reader.close(); writer.close(); reader.open(); - RB Michael McCandless <[EMAIL PROTEC

Re: How to delete old index

2007-11-25 Thread Michael McCandless
"Cool Coder" <[EMAIL PROTECTED]> wrote: > Yes. Because I cannot close IndexReader in the live system. And also I > am running on Windows server. > At the end of index writing, I close writer and also reopen reader OK, I'm glad we have it explained! > writer.close() > reader.close(); >

Re: How to delete old index

2007-11-25 Thread Cool Coder
>Ahh, OK. Are you leaving your old IndexReader open against the index while >your >new IndexWriter is creating the new index? Are you running on Windows? Yes. Because I cannot close IndexReader in the live system. And also I am running on Windows server. At the end of index writing, I

Re: How to delete old index

2007-11-25 Thread Michael McCandless
Ahh, OK. Are you leaving your old IndexReader open against the index while your new IndexWriter is creating the new index? Are you running on Windows? If so, then this behavior makes sense: the old IndexReader will prevent deletion of all files it is using (which is all files in the index whe

Re: How to delete old index

2007-11-25 Thread Cool Coder
>What do you mean by "you can see two index"? I can see two sets of lucene index files with same size and time stamp difference is 4 hrs. E.g. At start up , the lucence generated index file _8w.cfs (also some more files) with size 4 MB and time stamp November 24, 2007, 2:57:48 PM

Re: How to delete old index

2007-11-25 Thread Michael McCandless
"Cool Coder" <[EMAIL PROTECTED]> wrote: > Hi, > I used have index refreshed in every 4 hr. However after each > refresh, I can see two index. I am not sure how can I delete old > index. What do you mean by "you can see two index"? > On starting of indexing process, I creat

How to delete old index

2007-11-24 Thread Cool Coder
Hi, I used have index refreshed in every 4 hr. However after each refresh, I can see two index. I am not sure how can I delete old index. On starting of indexing process, I create Writer writer = new IndexWriter(luceneDirectory,false,luceneAnalyzer,true); At the end of Indexing