lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Weber <>
Subject Autocommit After Being Idle for X Milliseconds
Date Fri, 02 Oct 2009 05:56:06 GMT
Hi guys,

I have a need to commit after a certain amount documents have been fed  
OR after a given amount of idle time.  Autocommit currently supports  
the max documents, however, the maxTime setting does not work for me  
because it is time since the first batch was submitted, not the last  
batch.  After looking through the code is seems fairly trivial to add  
this support, however I want to get everyones opinion on what should  
take precedence (idle time or max time) if both happen to be set in  
solrconfig?  I would imagine that max time trumps idle time, thoughts?

Also, looking at the current code I see this particular block in the  
addedDocument method of the CommitTracker class:

       // maxTime-triggered autoCommit
       long ctime = (commitWithin>0) ? commitWithin : timeUpperBound;
       if( ctime > 0 ) {
         _scheduleCommitWithin( ctime );

This means that if commitWithin is defined, it always takes precedence  
over timeUpperBound.  What if timeUpperBound is less than  
commitWithin?  I think this piece of code should schedule the commit  
within the shortest amount of time. Something like this:

long ctime = (commitWithin > 0 && commitWithin < timeUpperBound) ?  
commitWithin : timeUpperBound;

Is this correct?


Matt Weber

View raw message