code: private synchronized void checkFlush()
     {
        // avoid frequent flushes during reindexing;
        long idleTime = online.get() ? System.currentTimeMillis() - lastFlushTime : 0;
        long volatileTime = System.currentTimeMillis() - lastFileSystemFlushTime;
        // do not flush if volatileIdleTime is zero or negative
        if ((handler.getVolatileIdleTime() > 0 && idleTime > handler.getVolatileIdleTime() * 1000)
           || (handler.getMaxVolatileTime() > 0 && volatileTime > handler.getMaxVolatileTime() * 1000))
        {
           try
           {
              if (redoLog.hasEntries())
              {
                 LOG.debug("Flushing index after being idle for " + idleTime + " ms.");
                 synchronized (updateMonitor)
                 {
                    //updateInProgress = true;
                    indexUpdateMonitor.setUpdateInProgress(true, true);
                 }
                 try
                 {
                    flush();
                 }
                 finally
                 {
                    synchronized (updateMonitor)
                    {
                       //updateInProgress = false;
                       indexUpdateMonitor.setUpdateInProgress(false, true);
                       updateMonitor.notifyAll();
                       releaseMultiReader();
                    }
                 }
              }
           }
           catch (IOException e)
           {
              LOG.error("Unable to commit volatile index", e);
           }
        }
     }
docs: Checks the duration between the last commit to this index and the current
  time and flushes the index (if there are changes at all) if the duration
  (idle time) is more than {@link SearchIndex#getVolatileIdleTime()}
  seconds.