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 Ramprakash Ramamoorthy <yo...@gmail.com> on 2012/06/27 07:55:10 UTC

Auto commit when flush

Dear,

        I am using Lucene for my log search tool. Is there a way I can
automatically perform a commit operation on my IndexWriter when a
particular set of docs is flushed from memory to the disk. My RamBufferSize
is 24Mb and MergeFactor is 10.

        Or is calling commit in manually calculated frequent intervals
irrespective of the flushes the only way? I wish the autocommit  feature
was not deprecated.

-- 
With Thanks and Regards,
Ramprakash Ramamoorthy,
Engineer Trainee,
Zoho Corporation.
+91 9626975420

Re: Auto commit when flush

Posted by Shai Erera <se...@gmail.com>.
You could extend IndexWriter to AutoCommitIndexWriter and override flush()
to call super.flush() then commit() (or simply just commit()). I haven't
tested it but I think it should work.

However, make sure you understand the implications of commit() -- it's
heavier than just flush. Perhaps you can avoid calling commit() frequently,
and use NRT to obtain a fresh IndexReader over the flushed yet uncommitted
data.

If you don't want to periodically reopen that reader, then you could check
after every addDocument if the IW RAM size has decreased (which indicates
flush occurred), or move to use flush-by-doc-count and reopen every
maxBufferedDocs.

Hope this helps.

Shai

On Thu, Jun 28, 2012 at 9:42 AM, Aditya <fi...@gmail.com>wrote:

> Hi Ram,
>
> I guess IndexWriter.SetMaxBufferedDocs will help...
>
> Regards
> Aditya
> www.findbestopensource.com
>
>
> On Wed, Jun 27, 2012 at 11:25 AM, Ramprakash Ramamoorthy <
> youngestachiever@gmail.com> wrote:
>
> > Dear,
> >
> >        I am using Lucene for my log search tool. Is there a way I can
> > automatically perform a commit operation on my IndexWriter when a
> > particular set of docs is flushed from memory to the disk. My
> RamBufferSize
> > is 24Mb and MergeFactor is 10.
> >
> >        Or is calling commit in manually calculated frequent intervals
> > irrespective of the flushes the only way? I wish the autocommit  feature
> > was not deprecated.
> >
> > --
> > With Thanks and Regards,
> > Ramprakash Ramamoorthy,
> > Engineer Trainee,
> > Zoho Corporation.
> > +91 9626975420
> >
>

Re: Auto commit when flush

Posted by Li Li <fa...@gmail.com>.
flush is not commit.

On Thu, Jun 28, 2012 at 2:42 PM, Aditya <fi...@gmail.com> wrote:
> Hi Ram,
>
> I guess IndexWriter.SetMaxBufferedDocs will help...
>
> Regards
> Aditya
> www.findbestopensource.com
>
>
> On Wed, Jun 27, 2012 at 11:25 AM, Ramprakash Ramamoorthy <
> youngestachiever@gmail.com> wrote:
>
>> Dear,
>>
>>        I am using Lucene for my log search tool. Is there a way I can
>> automatically perform a commit operation on my IndexWriter when a
>> particular set of docs is flushed from memory to the disk. My RamBufferSize
>> is 24Mb and MergeFactor is 10.
>>
>>        Or is calling commit in manually calculated frequent intervals
>> irrespective of the flushes the only way? I wish the autocommit  feature
>> was not deprecated.
>>
>> --
>> With Thanks and Regards,
>> Ramprakash Ramamoorthy,
>> Engineer Trainee,
>> Zoho Corporation.
>> +91 9626975420
>>

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


Re: Auto commit when flush

Posted by Aditya <fi...@gmail.com>.
Hi Ram,

I guess IndexWriter.SetMaxBufferedDocs will help...

Regards
Aditya
www.findbestopensource.com


On Wed, Jun 27, 2012 at 11:25 AM, Ramprakash Ramamoorthy <
youngestachiever@gmail.com> wrote:

> Dear,
>
>        I am using Lucene for my log search tool. Is there a way I can
> automatically perform a commit operation on my IndexWriter when a
> particular set of docs is flushed from memory to the disk. My RamBufferSize
> is 24Mb and MergeFactor is 10.
>
>        Or is calling commit in manually calculated frequent intervals
> irrespective of the flushes the only way? I wish the autocommit  feature
> was not deprecated.
>
> --
> With Thanks and Regards,
> Ramprakash Ramamoorthy,
> Engineer Trainee,
> Zoho Corporation.
> +91 9626975420
>