lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: IndexWriter: setRAMBufferSizeMB
Date Fri, 08 Feb 2008 18:34:02 GMT
Well ... every time the RAM buffer is full, a new segment is flushed
to the Directory, but that is not necessarily a "commit" in that
an IndexReader would see the new segment, nor, that the segment would
survive if the machine suddenly crashed.

You should't rely on when specifically IndexWriter makes its changes
visible to readers.  The best way to be sure is to close the writer.

There is work underway now, in this issue:

that will add an explicit "commit" call, which you would use to 1)
make the changes visible to readers, and 2) sync the index such that
if the machine crashed (after commit returns) then your changes as of
the commit will survive.  But it's not committed yet ... it will be in

One way for a reader to check if a new commit has happened is to
call the isCurrent method.  Maybe that helps?


<> wrote:

> Hi,
> if I understand this property correctly every time the ram buffer  
> is full it
> gets automaticaly written to disk. Something like a commit in a  
> database.
> Thus if my application dies, all docs in the buffer get lost. Right?
> If so, is there any event/callback etc. which informs my  
> application that
> such a commit happend?
> Thank you.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message