lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ganesh" <emailg...@yahoo.co.in>
Subject Re: Index files not deleted after optimization
Date Fri, 06 Nov 2009 07:22:14 GMT
Thanks Michael.

Below order helped to solve the issue,

1. DB optimize
2. DB commit
3. Reopen new reader
4. Close old reader
5. Close writer
6. Open writer

Regards
Ganesh


 
----- Original Message ----- 
From: "Michael McCandless" <lucene@mikemccandless.com>
To: <java-user@lucene.apache.org>
Sent: Tuesday, November 03, 2009 9:05 PM
Subject: Re: Index files not deleted after optimization


> On Tue, Nov 3, 2009 at 9:45 AM, Ganesh <emailgane@yahoo.co.in> wrote:
>> My IndexReader and Searcher is open all the time. I am reopening it at constant interval.
>>
>> Below are the code sequence.
>>
>> 1. DB optimize
>> 2. Close writer
>> 3. Open writer
>> 4. Reopen new reader
>> 5. Close old reader
>> 6. Close old searcher.
> 
> Assuming there is an implicit:
> 
>  0. Open a reader/searcher
> 
> Then it's expected after step 6 that you have leftover files, because
> the writers in step 2 and 3 were unable to delete the files since the
> reader from step 0 still had them open.  Once you open a new writer,
> or commit any changes with the existing writer, the files will be
> deleted.
> 
>>>>If the old IndexReader is still open when the optimize completes then the
files it has open cannot be deleted.
>> If reader should not be opened while doing optimize then User cannot perform search
during the time period.
> 
> It's fine to leave a reader open... it just means the old files will
> persist until the writer is able to delete them.
> 
> Mike
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
Send instant messages to your online friends http://in.messenger.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message