lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Rutherglen <jason.rutherg...@gmail.com>
Subject Re: file open handles?
Date Tue, 26 Jan 2010 19:40:01 GMT
Jamie,

Are you calling close on the reader?

Jason

On Tue, Jan 26, 2010 at 11:23 AM, Jamie <jamie@stimulussoft.com> wrote:
> Hi Erick
>
> Our app is a long running server. Is it a problem if indexes are never
> closed? Our searchers
> do see the latest snapshot as we use writer.getReader() method for fast
> searches.
> In our case, the index is written to continously, and there are many clients
> reading from the
> index simultaneously. Our indexing process keeps the index open at all times
> and merely
> commits changes to the index. Obviously, when the server is stopped, the
> index is closed.
> When searches take place, we use getReader from the IndexWriter. Should
> there be a close
> taking place?
>
> Jamie
>
>
>
>
> On 2010/01/26 08:54 PM, Erick Erickson wrote:
>>
>> They should disappear when the last program holding them open
>> closes them or terminates. So I'm guessing that you have a
>> searcher or some such still accessing the files. This is why
>> your searcher doesn't see new additions until you reopen it,
>> the "snapshot" the literature talks about is just the old files.
>>
>> Do note a common pitfall with Lucene's reopen is that reopen
>> does NOT close the underlying reader, you have to do that yourself.
>> See the docs for IndexReader.reopen, it even has a code snippet.
>>
>> So no, don't worry about it *if* your program is closing its
>> IndexReaders/Writers correctly.
>>
>> HTH
>> Erick
>>
>> On Tue, Jan 26, 2010 at 1:20 PM, Jamie<jamie@stimulussoft.com>  wrote:
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
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