Determines the amount of RAM that may be used for buffering added documents and deletions before they are flushed to the Directory. Generally for faster indexing performance it's best to flush by RAM usage instead of document count and use as large a RAM buffer as you can.

When this is set, the writer will flush whenever buffered documents and deletions use this much RAM. Pass in {@link #DISABLE_AUTO_FLUSH} to prevent triggering a flush due to RAM usage. Note that if flushing by document count is also enabled, then the flush will be triggered by whichever comes first.

NOTE: the account of RAM usage for pending deletions is only approximate. Specifically, if you delete by Query, Lucene currently has no way to measure the RAM usage if individual Queries so the accounting will under-estimate and you should compensate by either calling commit() periodically yourself, or by using {@link #setMaxBufferedDeleteTerms} to flush by count instead of RAM usage (each buffered delete Query counts as one).

NOTE: because IndexWriter uses

CopyC#
int
s when managing its internal storage, the absolute maximum value for this setting is somewhat less than 2048 MB. The precise limit depends on various factors, such as how large your documents are, how many fields have norms, etc., so it's best to set this value comfortably under 2048.

The default value is {@link #DEFAULT_RAM_BUFFER_SIZE_MB}.

enabled but non-positive, or it disables ramBufferSize when maxBufferedDocs is already disabled

Namespace: Lucene.Net.Index
Assembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1

Syntax

C#
public virtual void SetRAMBufferSizeMB(
	double mb
)
Visual Basic
Public Overridable Sub SetRAMBufferSizeMB ( _
	mb As Double _
)
Visual C++
public:
virtual void SetRAMBufferSizeMB(
	double mb
)

Parameters

mb
Type: System..::..Double

[Missing <param name="mb"/> documentation for "M:Lucene.Net.Index.IndexWriter.SetRAMBufferSizeMB(System.Double)"]

See Also