lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luocan19826...@sohu.com
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 [mailto:lucene@mikemccandless.com]
发送时间: 2010年3月14日 18:14
收件人: java-user@lucene.apache.org
主题: Re: about lucene in action 2
<o:p>&nbsp;</o:p>
Flushing means stuff (added docs, deletions) buffered in RAM are moved to disk, ie, written
as new segment files.
<o:p>&nbsp;</o:p>
But the new segments_N file, referencing these new segments, is not written.
<o:p>&nbsp;</o:p>
Nor are the files "sync"'d.
<o:p>&nbsp;</o:p>
This means a newly opened or reopened reader will not see the changes.
<o:p>&nbsp;</o:p>
In order to make the changes "visible" you have to call IndexWriter.commit.
<o:p>&nbsp;</o:p>
Mike
<o:p>&nbsp;</o:p>
On Sun, Mar 14, 2010 at 2:36 AM, luocanrao &lt;luocan19826164@sohu.com&gt; wrote:
&gt; I am reading lucene in action 2,there is some question about it.
&gt;<o:p>&nbsp;</o:p>
&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;<o:p>&nbsp;</o:p>
&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;<o:p>&nbsp;</o:p>
&gt;<o:p>&nbsp;</o:p>
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
&gt; For additional commands, e-mail: java-user-help@lucene.apache.org
&gt;<o:p>&nbsp;</o:p>
&gt;<o:p>&nbsp;</o:p>
<o:p>&nbsp;</o:p>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message