Method SetRAMBufferSizeMB
SetRAMBufferSizeMB(Double)
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 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 SetMaxBufferedDeleteTerms(Int32) to flush by count instead of RAM usage (each buffered delete Query counts as one).
NOTE: because IndexWriter uses 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 DEFAULT_RAM_BUFFER_SIZE_MB.
Declaration
public virtual void SetRAMBufferSizeMB(double mb)
Parameters
Type | Name | Description |
---|---|---|
System.Double | mb |