lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: Searching while optimizing
Date Tue, 24 Nov 2009 10:02:58 GMT
How about newReader()?

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Michael McCandless [mailto:lucene@mikemccandless.com]
> Sent: Tuesday, November 24, 2009 11:00 AM
> To: java-user@lucene.apache.org
> Subject: Re: Searching while optimizing
> 
> On Tue, Nov 24, 2009 at 1:44 AM, vsevel <v.sevel@lombardodier.com> wrote:
> >
> > 1) correct: I am using IndexWriter.getReader(). I guess I was assuming
> that
> > was a privately owned object and I had no business dealing with its
> > lifecycle. the api would be clearer to rename the operation
> createReader().
> 
> I just committed an addition to the javadocs that the caller is
> responsible for closing the returned reader.
> 
> I think createReader() isn't great either because it sound more
> expensive than it is -- under the hood, the returned reader is
> typically sharing many subreaders with the last reader obtained.  That
> sharing is what makes the reopen time fast.
> 
> > 2) how much transient disk space should I expect? isn't this pretty much
> > what the index writer javadoc said we should not do: "When running in
> this
> > mode, be careful not to refresh your readers while optimize or segment
> > merges are taking place as this can tie up substantial disk space."
> 
> It is exactly what the javadoc says you should not do, but if you know
> the risks, go for it ;)
> 
> How much space is tied up depends on how often you reopen and how
> quickly you close the last reader.  If eg you aggressively close the
> last reader, such that effectively only one reader is open at once,
> then I think you're looking at worst case index consumes 4X it's
> "nominal" size (vs 3X if you don't open a single reader).
> 
> Mike
> 
> ---------------------------------------------------------------------
> 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