lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smiley <dsmi...@mac.com>
Subject Re: CachedSearcher
Date Tue, 16 Jul 2002 02:55:49 GMT

On Monday, July 15, 2002, at 10:19  PM, Kelvin Tan wrote:

>> FSDirectory closes files as they're GC'd, so you
>> don't have to explicitly close the IndexReaders or Searchers.
>>
>> Doug
>>
>
> hmmm...is this documented somewhere? I go through quite abit of trouble
> just to close Searchers (because Hits become invalid when the 
> Searcher is
> closed).
>
> If the object has a close() method with public modifier, isn't it a 
> common
> idiom that client code needs to invoke close() explicitly?

I absolutely agree.  If letting it get GC'ed is fine, then just about 
any other name, like "dispose" might be better.

> If there's no
> real need to call close, maybe it can be changed to protected?

I wouldn't go that far.

~ David Smiley


--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message