code: func (conf *LiveIndexWriterConfigImpl) SetMaxBufferedDocs(maxBufferedDocs int) *LiveIndexWriterConfigImpl {
  	assert2(maxBufferedDocs == DISABLE_AUTO_FLUSH || maxBufferedDocs >= 2,
  		"maxBufferedDocs must at least be 2 when enabled")
  	assert2(maxBufferedDocs != DISABLE_AUTO_FLUSH || conf.ramBufferSizeMB != DISABLE_AUTO_FLUSH,
  		"at least one of ramBufferSize and maxBufferedDocs must be enabled")
  	conf.maxBufferedDocs = maxBufferedDocs
  	return conf
  }
docs: // L358
  /*
  Determines the minimal number of documents required before the
  buffered in-memory documents are flushed as a new Segment. Large
  values generally give faster indexing.
  
  When this is set, the writer will flush every maxBufferedDocs added
  documents. Pass in DISABLE_AUTO_FLUSH to prevent triggering a flush
  due to number of buffered documents. Note that if flushing by RAM
  usage is also enabled, then the flush will be triggered by whichever
  comes first.
  
  Disabled by default (writer flushes by RAM usage).
  
  Takes effect immediately, but only the next time a document is added,
  updated or deleted.
  */