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 Cam Bazz <ca...@gmail.com> on 2008/01/21 15:30:41 UTC
Clarification about IndexWriter.deleteDocuments and flush.
Hello,
When we delete documents from index - will it autoflush when count of
deleted documents reach a certain value. I am controlling my own flush
operation, and I have disabled autoflush by:
writer.setMaxBufferedDocs(IndexWriter.DISABLE_AUTO_FLUSH);
But I have taken a peek at the IndexWriter and the DocumentWriter source
codes and from what I understand delete will flush the index when it reaches
a certain threshold.
But I am not sure if that will happen when the autoflush is disabled.
Also when deleted documents trigger a flush, that will be a cumulative flush
that flushes all the addDocs as well? is this correct?
Best,
-C.B.
Re: Clarification about IndexWriter.deleteDocuments and flush.
Posted by Cam Bazz <ca...@gmail.com>.
Thanks Michael,
> Right, if you disable it (as above), it won't flush by count but
> rather by RAM.
I had made a test case monitoring ram usage and never flushing manually -
(with disabled autoflush)
and I think it wont flush itself when it reaches a certain buffered ram.
Having read the source to lucene made makes me think of extensions. Nice
code.
Best,
On Jan 21, 2008 4:47 PM, Michael McCandless <lu...@mikemccandless.com>
wrote:
>
> Cam Bazz wrote:
>
> > Hello,
> >
> > When we delete documents from index - will it autoflush when count of
> > deleted documents reach a certain value. I am controlling my own flush
> > operation, and I have disabled autoflush by:
> >
> > writer.setMaxBufferedDocs(IndexWriter.DISABLE_AUTO_FLUSH);
>
> By default (in 2.3) the writer only flushes when RAM usage hit 16
> MB. It should not flush due to # buffered docs nor # buffered delete
> terms, and, that method call shouldn't be necessary since it's
> already the default.
>
> >
> > But I have taken a peek at the IndexWriter and the DocumentWriter
> > source
> > codes and from what I understand delete will flush the index when
> > it reaches
> > a certain threshold.
> > But I am not sure if that will happen when the autoflush is disabled.
>
> Right, if you disable it (as above), it won't flush by count but
> rather by RAM.
>
> > Also when deleted documents trigger a flush, that will be a
> > cumulative flush
> > that flushes all the addDocs as well? is this correct?
>
> Yes whenever a flush occurs (due to any trigger) both buffered docs
> and buffered deletes are flushed.
>
> Mike
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
Re: Clarification about IndexWriter.deleteDocuments and flush.
Posted by Michael McCandless <lu...@mikemccandless.com>.
Cam Bazz wrote:
> Hello,
>
> When we delete documents from index - will it autoflush when count of
> deleted documents reach a certain value. I am controlling my own flush
> operation, and I have disabled autoflush by:
>
> writer.setMaxBufferedDocs(IndexWriter.DISABLE_AUTO_FLUSH);
By default (in 2.3) the writer only flushes when RAM usage hit 16
MB. It should not flush due to # buffered docs nor # buffered delete
terms, and, that method call shouldn't be necessary since it's
already the default.
>
> But I have taken a peek at the IndexWriter and the DocumentWriter
> source
> codes and from what I understand delete will flush the index when
> it reaches
> a certain threshold.
> But I am not sure if that will happen when the autoflush is disabled.
Right, if you disable it (as above), it won't flush by count but
rather by RAM.
> Also when deleted documents trigger a flush, that will be a
> cumulative flush
> that flushes all the addDocs as well? is this correct?
Yes whenever a flush occurs (due to any trigger) both buffered docs
and buffered deletes are flushed.
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org