You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by luocanrao <lu...@sohu.com> on 2010/03/14 08:36:51 UTC

about lucene in action 2

I am reading lucene in action 2,there is some question about it.

When a flush occurs, the writer creates new segment and deletion files in
the Directory. However,
these files are neither visible nor usable to a newly opened IndexReader
until the writer commits the
changes. It's important to understand this difference. Flushing is done to
free up memory consumed by
buffered changes to the index, whereas committing is done to make all
flushed changes persistent and
visible in the index.

Why Flushing does not make all flushed changes persistent even if it had
created new segment?
Flushing does not mean flush any change to disk?


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


Re: about lucene in action 2

Posted by Michael McCandless <lu...@mikemccandless.com>.
Flushing means stuff (added docs, deletions) buffered in RAM are moved
to disk, ie, written as new segment files.

But the new segments_N file, referencing these new segments, is not written.

Nor are the files "sync"'d.

This means a newly opened or reopened reader will not see the changes.

In order to make the changes "visible" you have to call IndexWriter.commit.

Mike

On Sun, Mar 14, 2010 at 2:36 AM, luocanrao <lu...@sohu.com> wrote:
> I am reading lucene in action 2,there is some question about it.
>
> When a flush occurs, the writer creates new segment and deletion files in
> the Directory. However,
> these files are neither visible nor usable to a newly opened IndexReader
> until the writer commits the
> changes. It's important to understand this difference. Flushing is done to
> free up memory consumed by
> buffered changes to the index, whereas committing is done to make all
> flushed changes persistent and
> visible in the index.
>
> Why Flushing does not make all flushed changes persistent even if it had
> created new segment?
> Flushing does not mean flush any change to disk?
>
>
> ---------------------------------------------------------------------
> 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