lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject 答复: about lucene in action 2
Date Sun, 14 Mar 2010 12:34:11 GMT
Thanks very much for your patience!
Nor are the files "sync"'d.?It means something like reading disk file to RAM,so reader can
see it?
And why flushing(reopen) is much faster than commit? flushing means writing stuff to disk,
commit means writing stuff to disk and then reading the new created disk file("sync ").
I guess commit only cost twice time than flush?
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p>&nbsp;</o:p>
发件人: Michael McCandless []
发送时间: 2010年3月14日 18:14
主题: Re: about lucene in action 2
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.
On Sun, Mar 14, 2010 at 2:36 AM, luocanrao &lt;; wrote:
&gt; I am reading lucene in action 2,there is some question about it.
&gt; When a flush occurs, the writer creates new segment and deletion files 
&gt; in the Directory. However, these files are neither visible nor usable 
&gt; to a newly opened IndexReader until the writer commits the changes. 
&gt; It's important to understand this difference. Flushing is done to free 
&gt; up memory consumed by buffered changes to the index, whereas 
&gt; committing is done to make all flushed changes persistent and visible 
&gt; in the index.
&gt; Why Flushing does not make all flushed changes persistent even if it 
&gt; had created new segment?
&gt; Flushing does not mean flush any change to disk?
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail:
&gt; For additional commands, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message